Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: JavaScript
Expertise: Intermediate
Jun 8, 2005

Accessing Server Controls Using JavaScript

Suppose you have a Web server control called TextBox in your Web page:

<asp:TextBox id="Test" Text="Sample" runat="server">
You can access this value in a couple ways using JavaScript:
  1. 
    document.getElementById('<%=Test.ClientID%>').value;
    
    ClientID - server control identifier generated by ASP.NET
    
  2. 
    document.forms[0]['Test'].value;
    
Santhi Maadhaven
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap