#me { float: left; }

August 27, 2008

AJAX Control Toolkit is not defined in Firefox

Filed under: AJAX Control Toolkit, ASP.NET, ASP.NET AJAX — Simon Rigby @ 3:20 pm

I had a really confusing issue lately. I had a master page which was parenting a few pages in a website. The master page contained a reference to a ToolkitScriptManager. In one page I had a CalendarExtender which was targetting a textbox for the good old ubiquitous ‘pop-up’ calendar for selecting dates.

It worked flawlessly on one page but not on the other despite the fact that the code was near enough to identical. I tried everything. Removing the bin reference to the toolkit. Re adding the control from scratch etc etc etc., but to no avail, one page worked fine but on the other all AJAX functionality stopped (including the accordion control on the left that worked fine everywhere else. In Firefox the Error Console reported that AJAX Control Toolkit was undefined).

Because I was trying everything I removed the ToolkitScriptManager from the master page and replaced it with a standard ScriptManager. Viola, everything worked. I have no explanation for this, and at this point in time I have no time to research it further (I will do and post an update when I’ve had a chance to take a look).

For now, maybe it’s worth a try if you experience this issue.

August 26, 2008

CalendarExtender and getting the correct date format

Filed under: AJAX Control Toolkit, ASP.NET — Simon Rigby @ 9:46 pm

When using the CalendarExtender from the Ajax Control Toolkit to add pop up functionality to a text box, there are a couple of things you need to do to ensure that the date format in the text box is correct for your culture.

Firstly, add Culture and UI Culture information to your web.config file. In short add an element to the <system.web> section. In my case (UK English) I add <globalization uiCulture="en" culture="en-GB" /> to this element.

For example:

<system.web>
    <globalization uiCulture="en" culture="en-GB" />
</system.web>

Secondly, you need to instruct the script manager to actually take note of this. You do this by setting the EnableScriptGlobalization and EnableScriptLocalization to true as properties of the ScriptManager.

For example:

<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"
    EnablePartialRendering="true"
    EnableScriptGlobalization="true"
    EnableScriptLocalization="true">
</cc1:ToolkitScriptManager>

Done deal <grin>

Theme: WordPress Classic. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.