Print
Add To Favorites
Email To Friend
Rate This Article
|
Using JavaScript Effectively in ASP.NET 2.0 - Part 1
|
Published:
17 Sep 2008
|
Abstract
The .NET Framework 2.0 introduced many new feature that make JavaScript usage with ASP.NET pages easy. The ClientScriptManager class in the framework has many new useful methods that help developers use these features very effectively. In this first part of the series, Satheesh discusses some of the common scenarios to use the frequently used overload methods of the ClientScriptManager class. He starts with an overview of the ClientScriptManager class and then examines the RegisterClientScriptBlock, RegisterStartupScript, and RegisterOnSubmitStatement methods with the help of relevant source code, screenshots and usage instructions. |
 |
by Satheesh Babu
Feedback
|
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days):
7250/
302
|
|
|
|
| Introduction |
JavaScript is one of the very versatile scripting languages
that are used in Web applications. Even though we can accomplish everything in
server side programming using C#, we can still prefer to do some of the things,
like validations, etc., using JavaScript. In ASP.NET 1.x, we do not have that
much support in the framework to hook JavaScript functions from the asp.net
page dynamically. This drawback was addressed with the release of ASP.NET 2.0
by providing developers a lot of features to embed JavaScript blocks
dynamically through a class called ClientScriptManager. I have divided this
article into 2 parts. Part 1 will deal with 3 different methods that are packed
with ClientScriptManager class with examples, while the Part 2 will discuss the
left out methods with some other useful JavaScript tips for ASP.NET.
|
|
|
|
|
Article Feedback
User Comments
Title:
Good Article
Name:
greeny
Date:
12/20/2008 2:52:31 AM
Comment:
Hi,
good to see easily understandable article.
|
Title:
Great Article
Name:
J
Date:
12/9/2008 5:46:12 AM
Comment:
This was the first article I read on RegisterStartupScript. Very easy to understand article with nice examples. Thanks a lot for shairing this
|
Title:
Programmer
Name:
Tonci Korsano
Date:
9/30/2008 2:38:46 PM
Comment:
Hi,
I think this is a good article. RegisterOnSubmitStatement() Method was explained in a simple way. I might have to use this method. However, I have read that in these methods it is more efficient to use typeOf(this) or typeOf(Page) instead of this.getType() or Page.getType()
Tonci.
|
Title:
RE: how to execute onsumit in between the server code
Name:
Mikalai
Date:
9/26/2008 10:51:03 AM
Comment:
To Nonu: do not be confused with server and client side code. alert could be only displayed when server side code is finished and result html is sent to the client.
|
Title:
how to execute onsumit in between the server code
Name:
Nonu
Date:
9/25/2008 11:06:28 AM
Comment:
Hi Your article is helped me a lot to understand clientscript class. but i want to execute a alert in between the server side code.
|
Title:
Good Article
Name:
Joe
Date:
9/17/2008 11:47:12 PM
Comment:
Satheesh, Your article is really good! It is really useful to people like me! Thanks again!
|
Title:
Mr.
Name:
kmanral
Date:
9/17/2008 2:52:58 PM
Comment:
only useful part of article is the link to MSDN. oops...
|
|
Product Spotlight
|
|
|