ASP.NET 1.1 to ASP.NET 2.0 Migration #11

This is a life saving tip. Well of course you can find in google about this, but it saves me a lot today. Basically this method is use to register Javascripts. If you don't deal with this, won't be useful for you. It is worthfile to notice it.

 

.NET 1.1

Page.RegisterStartupScript("StartupTitle", szTitle); // deprecated, but if you choose to use, still possible. Just you will face some weird problems, like javascript is not functioning as you originally planned.

 

Do this in .NET 2.0 then:

Page.ClientScript.RegisterStartupScript(this.GetType(), "StartupTitle", szTitle); // advisable to use this instead.

Published Friday, December 01, 2006 10:03 PM by chuawenching
Filed under: ,