hi i want to know about pass the data in hidden field
you had any refference for it.
<@> rpkaran <@>
how to pass the data in hidden fieldhow to pass the data in hidden field
Page 1 of 1
1 Replies - 3860 Views - Last Post: 15 June 2010 - 08:01 AM
Replies To: how to pass the data in hidden field
#2
Re: how to pass the data in hidden field
Posted 15 June 2010 - 08:01 AM
The first thing that you would have to do is add an ASP.NET HiddenField control to the page.
In your server-side code (C#, or VB.NET) you can set the value of the HiddenField by setting it's Value Property to whatever data that you want to store within it. You can also use the Value Property to retrieve the value stored within it.
HiddenField controls are particularly useful if you need to pass values between Javascript code and your ASP.NET Server-Side code. You can get a reference to the HiddenField control using the Javascript document.getElementById() method. You would pass the HiddenField's ClientID Property to the document.getElementById() method something like this:
(C# code):
-Frinny
In your server-side code (C#, or VB.NET) you can set the value of the HiddenField by setting it's Value Property to whatever data that you want to store within it. You can also use the Value Property to retrieve the value stored within it.
HiddenField controls are particularly useful if you need to pass values between Javascript code and your ASP.NET Server-Side code. You can get a reference to the HiddenField control using the Javascript document.getElementById() method. You would pass the HiddenField's ClientID Property to the document.getElementById() method something like this:
(C# code):
myButton.Attributes.Add("onclick","document.getElementById('"+myHiddenField.ClientID+"').value = 'myButton was clicked';");
-Frinny
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|