June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to add client-side JavaScript code to a Web form.
Use the Page.RegisterClientScriptBlock method to add JavaScript functions to a page, and add control attributes that call the functions.
ASP.NET includes a rich programming model. Unfortunately, once a page is rendered to HTML, you can’t execute any more .NET code without first triggering a postback to the server. This limitation greatly reduces the effectiveness of validation code and other niceties that can lead to a more professional Web page.
Although .NET does not include any object interface for creating JavaScript, you can define a block of JavaScript code in a .NET string variable and instruct ...
Read now
Unlock full access