Vivek Thakur

Chaotically Complex

  Home  |   Contact  |   Syndication    |   Login
  102 Posts | 1 Stories | 316 Comments | 66 Trackbacks

News



Archives

ASP.NET Ventures

In ASP.NET 2.0, a new class ClientScriptManager is introduced and the old method Page.RegisterClientScriptBlock is deprecated. Below is some sample code to register client script from an ASP.NET page:

if(!ClientScript.IsClientScriptBlockRegistered("ClosePopUp"))

{

ClientScript.RegisterClientScriptBlock(this.GetType(), "ClosePopUp", "your javascript code goes here");

}

Note the GetType() method, I recommend going through this post which sheds more light on the same:

http://blogs.ipona.com/james/archive/2006/10/03/6710.aspx

posted on Wednesday, July 11, 2007 4:19 PM

Feedback

# re: RegisterclientScript block in ASP.NET 2.0 7/12/2007 7:51 AM NIgel
You might want to look at your RegisterClientScriptBlock entry on your blog, something went really funky with your code

# re: RegisterclientScript block in ASP.NET 2.0 7/12/2007 9:01 AM Vivek
thanks, I have corrected it, seems like a sopy paste formatting issue with GWB.

Vivek

# re: RegisterclientScript block in ASP.NET 2.0 1/19/2008 8:15 PM aa
<table>
<tr>
<td>
</td>
</tr>
</table>

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 1 and 6 and type the answer here: