Displaying posts categorized under

Moving over to VS2005

Visual Studio 2005 Web Application Project

The web site project type in Visual Studio 2005  sure differs from the web applications you created in VS2003. App_Code directory for example – and the first thing you might find out when you are finally done woth your solution is - wher are the DLL:s to upload to the webservers bin directory??? I.e you need to Publish [...]

System.Web.UI.Page.RegisterClientScriptBlock(string, string) is obsolete

The power of injecting JavaScript into your ASP.NET pages from your codebehind code is really important, considering that the controls client ID:s will not be the same as in your designtime ASPX file.
In ASP.NET 1.1 it was pretty easy to inject JavaScript by using this code

if [...]

System.Web.UI.Page.RegisterStartupScript(string,string) is obsolete

I bet you use the RegisterStartupScript a lot – in conjunction with IsClientScriptBlockRegistered it is an easy way to insert a chunk of Javascript code into your ASP.NET page.

if ( !Page.IsStartupScriptRegistered("mytest") )
Page.RegisterStartupScript("myrest", "<script>alert('Hello');</script>");

However, in ASP.NET 2.0 it [...]