October 2006 Entries

Don't use GetType() with Page.ClientScript.RegisterClientScriptBlock()

One of the things that was introduced in .NET 2.0 was a new mechanism for managing registration of client script into the page, via the new ClientScriptManager class, instead of the page's dedicated RegisterClientScriptBlock method. In the process of moving the API, MS also saw fit to add a new Type parameter to the method. This reflects the fact that the best practice when calling Page.RegisterClientScriptBlock was to formulate a unique key for your script that incorporated the fully qualified name of the class doing the registration of the script, as a way to avoid unseemly clashes between script registrations. That...

posted @ Tuesday, October 03, 2006 12:03 PM | Feedback (23)