Showing posts with label AjaxControlToolkit. Show all posts
Showing posts with label AjaxControlToolkit. Show all posts

SOLVED: Could not load type 'System.Web.UI.ScriptReferenceBase'

Posted on: Wednesday, 3 March 2010 20:23

Getting problems when you upload your Ajax Control Toolkit powered website up to your server? Read on for a quick and easy solution!

Scenario

If you have added some of the Ajax Control Toolkit extenders into your website you will have probably tested them out on your local dev computer and marvelled at how easy it was to add some impressive eye candy to your site. Then, just when you think your work is done for the day and its time to put your new creation online you are hit with an error:

Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Well you don't need to worry too much because this time it is a really simple fix.

Master user friendly date of birth selection with the AjaxControlToolkit Calendar extender

Posted on: Friday, 2 October 2009 21:19

The latest version of the AjaxControlTookit is out (September 2009 release) and it brings with it two new controls (Seadragon Image Viewer and AsyncFileUpload).

This release also has a heavy focus on quality with over 20 bugs fixed.

The most important one that caught my eye was the new Calendar attribute called DefaultView. This simple attribute will let you open up the calendar in a year -> month -> day order which means collecting date of birth information is now a lot more user friendly.

In previous releases you could switch to the year mode by clicking on the title bar of the calendar twice and experienced users knew this but the vast majority of the internet population didn't. For me this meant that I had to result to having "tip" messages on my forms so that I could be fairly sure that my poor users wouldn't sit there clicking backwards on the calendar for the whole day!

So bug number 9601 has been fixed and now we can do it easily. How easily? Well let me show you!

Code Sample

<asp:TextBox ID="DateOfBirth" runat="server" />
<cc1:CalendarExtender ID="DateOfBirth_CalendarExtender" runat="server" Enabled="True"
   TargetControlID="DateOfBirth" DefaultView="Years" />

As you can see the DefaultView attribute is set to years and when you click in the TextBox the Calendar pops up in year selection mode.

Downloadable Sample

An interactive downloadable sample can be downloaded here:

Further Reading

Where to get an asp.net 2.0 compatible AjaxControlToolkit

Posted on: Thursday, 17 September 2009 23:01

(Updated: To include the latest controls asp.net 2.0 users are missing out on)

This is just a simple link so that I don't have to keep finding it and explaining the situation each time the topic comes up.

Asp.net 2.0 support

The AjaxControlToolkit doesn't support asp.net 2.0 any more. This means that if you are still using asp.net 2.0 then you will have to download an older release.

The last version that was released with 2.0 support was toolkit version 1.0.20229. Download it here:

Asp.net 3.5 support

If you're looking for the latest 3.5 version then I suggest heading directly to the front page of the site so that you can get the latest version. Actually this url seems to automatically redirect you to the latest version available:

But if it breaks for you in the future then use this link and click the download button in the top right:

What's missing for asp.net 2.0 users?

The following controls (at the time of writing) are missing from the older AjaxControlToolkit:

  • HTMLEditor
  • ComboBox
  • ColorPicker
  • MultiHandleSlider
  • Seadragon Image Viewer
  • AsyncFileUpload

ModalPopupExtender Sys.ArgumentNullException Error

Posted on: Thursday, 13 August 2009 19:30

Are you are seeing this javascript error when you try to run a page with a ModalPopupExtender in it?

Error: Sys.ArgumentNullException: Value cannot be null.
Parameter name: element

Then the fix is probably pretty simple - you have put incorrect ID's in either the OkControlID or CancelControlID attributes.

You don't have to specify the OkControlID or CancelControlID's to use the ModalPopupExtender but if you do and you later rename the control or you simply mistype when setting it up the compiler will not catch this.

The error message could be more helpful but hopefully you will have found this article in your favourite search engine without much trouble!

Here is the official documentation and demo page for this control: