Asp Dot Net Notes for Web Masters RSS 2.0

# Wednesday, July 01, 2009
Set “pageExtension” to nothing to tell SiteFInity to use Extension less URLs.

The line to change looks like this:
<cms defaultProvider="Sitefinity" pageExtension=".aspx" disabled="false" pageEditorUIMode="Overlay">
Change  it so that the pageExtension property is empty liek this: pageExtension=""

Note: The FormsAthentication and RoleManager modules are not available for extensionless request but you need them for the admin section of Sitefinity.

To enable FormsAthentication and RoleManager add the runAllManagedModulesForAllRequests property to the modules section of the Web.Config file.
E.G. <modules runAllManagedModulesForAllRequests="true">

Now you should have Extension less URLs in Sitefinity.

Wednesday, July 01, 2009 12:07:14 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Configuration
# Sunday, June 21, 2009
Add functions such as Indent, Outdent, Custom Styles Selector, Custom Links Selector, Font Name, Font Size, Font ForeColor, Font BackColor, ConvertToLower, ConvertToUpper  Apply Custom Class Drop Down, Superscript, Subscript, Insert Paragraph, Insert Horizontal Rule, Help, Style Builder, Xhtml Validator, TrackChangesDialog, FormatCodeBlock, TableWizard, InsertSymbol etc.

To see available tools open file: Sitefinity/Admin/ControlTemplates/EditorToolsFileAll.xml.

E.g.
  <tools name="DropdownToolbar" dockable="false">
    <tool name="ForeColor" />
    <tool name="BackColor" />
    <tool separator="true" />
    <tool name="FontName" />
    <tool name="FontSize" />
    <tool name="ApplyClass" />
    <tool name="InsertCustomLink" />
    <tool name="FormatBlock" />
    <tool name="FormatStripper" />
  </tools>

Copy the required lines to the file: Sitefinity/Admin/ControlTemplates/EditorToolsFile.xml

Now save the file and and open Rad Editor to see the extra tools.

Sunday, June 21, 2009 8:27:10 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Controls
# Wednesday, June 03, 2009
When trying to add inline Java Script to a Generic Content control the script tags are HTML encoded / removed.
This is the default behaviour so we must enable script tags.

To do this you must edit the control template for Generic Content.

Open the following file in Visual Studio:
Sitefinity --> Admin --> ControlTemplates --> Generic_Content --> App_LocalResources --> ContentVersionView.aspx.resx

Add a new setting: ContentFilters = None

There are still some problems with this. E.g. If you use a noscript tag then the contents of that tag will still get HTML encoded.
Wednesday, June 03, 2009 4:25:05 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Controls
# Sunday, May 31, 2009

Radgrid;  Add New Record Button not visible

The first time you use RadGrid you may spend a lot of time trying to work out how to display the Add New Record Button. I had to search for ages to find out what to do to display the Add New Record Button.

The property you need to set is the CommandItemDisplay of the MasterTableView property.

In Visual Studio you can edit the properties of the RadGrid in the property editor window. Select the RadGrid on your page, and then find the property called MasterTableView and its child property CommandItemDisplay.  Now select one of the drop down options: None, Top, Bottom , TopAndBottom.  Like magic the Add new button appears.

Remember to set AllowAutomaticInserts to true if you are not writing your own insert code.

 The MasterTableView code that may look something like this, notice the property CommantItemDisplay="Top":

<MasterTableView DataKeyNames="PriceTypeID" 
        DataSourceID="PriceType_LinqDataSource" CommandItemDisplay="Top">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="PriceType" HeaderText="PriceType" 
            SortExpression="PriceType" UniqueName="PriceType">
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>

Sunday, May 31, 2009 2:04:38 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Controls
# Saturday, May 30, 2009
Non-Comptability Issue between ScriptReferences and OutputCache: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=389102

Work around:
  1. Downlaod Script Reference Profiler from codeplex.
  2. Reference the dll in your poject.
  3. Add the control to the aspx page. You can add it to the Visual Studio Toolbox or use LoadControl to add it to the page.
  4. View the page and you will see some text added to the page with all the script references that you need.
  5. Add those references to the script manager on the aspx page.
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    <Scripts>
        <asp:ScriptReference name="MicrosoftAjax.js"/>
        <asp:ScriptReference name="MicrosoftAjaxWebForms.js"/>
        <asp:ScriptReference name="AjaxControlToolkit.Common.Common.js" 
assembly="AjaxControlToolkit, Version=3.0.20820.16598, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>      <asp:ScriptReference name="AjaxControlToolkit.Compat.Timer.Timer.js"
assembly="AjaxControlToolkit, Version=3.0.20820.16598, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>      <asp:ScriptReference name="AjaxControlToolkit.Animation.Animations.js"
assembly="AjaxControlToolkit, Version=3.0.20820.16598, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>      <asp:ScriptReference name="AjaxControlToolkit.ExtenderBase.BaseScripts.js"
assembly="AjaxControlToolkit, Version=3.0.20820.16598, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/>      <asp:ScriptReference name="AjaxControlToolkit.CollapsiblePanel.CollapsiblePanelBehavior.js"
assembly="AjaxControlToolkit, Version=3.0.20820.16598, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"/> </Scripts> </asp:ScriptManager>
Now the scripts will be registered by the main page and you can use OutputCache on your user controls.

Saturday, May 30, 2009 5:53:16 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Caching
# Thursday, May 28, 2009
Essential webmaster tools:
  1. Google Webmaster Tools. Also see Google Webmaster Central on You Tube.
  2. Msn WebMaster Tools

Site Diagnostics:
  1. Google Safe Browsing Diagnostic Page: Diagnostic test for I-do-IT.COM.

Thursday, May 28, 2009 2:43:04 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Web Master Tools
# Monday, May 25, 2009
A Do Not Miss resource for CSS column layout design help.
YAML Builder for visual development

Monday, May 25, 2009 2:31:19 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
CSS
# Friday, May 22, 2009
Check out Free Website Templates for great templates and ideas to help design your web site.

Friday, May 22, 2009 2:59:26 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
CSS
# Sunday, May 17, 2009
To add a confirmation to the automatically generated delete button you can add an event handler to the ItemDataBund event of the grid. The code below adds a confirmation message that appears in a dialog box. The message also displays the row data to help the user know what he is deleting.
    public void PriceType_RadGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            //Get the Data we want to show to the User
            GridDataItem dataItem = e.Item as GridDataItem;
            string DataItem = dataItem["PriceType"].Text;

            //Add the message to the Button
            LinkButton button = e.Item.FindControl("AutoGeneratedDeleteButton") as LinkButton;
            button.Attributes["onclick"] = "return confirm('Are you sure you want to delete " +
            DataItem + "?')";
        }
    }

Sunday, May 17, 2009 3:27:45 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Controls
After patching to the latest version you may see a message like this:

Error:

Could not load file or assembly 'Telerik.Web.UI, Version=2008.3.1125.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

The cause of the problem:

The handlers registration line in the web.config ihas the wrong version number;
<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2008.3.1125.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>


Solution:

To solve the problem you can:
  1. Change the version number to the correct version number.
  2. Delete the version number so the line is now: <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>

Sunday, May 17, 2009 1:12:53 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Patching
Archive
<July 2009>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
I do I.T. Ltd.
Sign In
Statistics
Total Posts: 27
This Year: 0
This Month: 0
This Week: 0
Comments: 22
All Content © 2012, I do I.T. Ltd.