how to pass the data in hidden field

how to pass the data in hidden field

Page 1 of 1

1 Replies - 5171 Views - Last Post: 15 June 2010 - 08:01 AM Rate Topic: -----

#1 rpkaran  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-June 10

how to pass the data in hidden field

Posted 15 June 2010 - 02:53 AM

hi i want to know about pass the data in hidden field
you had any refference for it.


<@> rpkaran <@>
Is This A Good Question/Topic? 0
  • +

Replies To: how to pass the data in hidden field

#2 Frinavale  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 203
  • View blog
  • Posts: 776
  • Joined: 03-June 10

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):
myButton.Attributes.Add("onclick","document.getElementById('"+myHiddenField.ClientID+"').value = 'myButton was clicked';");


-Frinny
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1