arunendra
arunendra

Reputation: 21

How can I set value to Html hidden fields from asp.net

I have scenario, where there are html hidden fields, the page can be redirected to itself, with parameters, I have sessions too. Now depending on session value I want to set some hidden values, so that it can be picked up from javascript and can do certain operation. But, the problem is I have no idea about how to get/ set values into html controls using asp.net, and also do not know whether this is possible or not. Please note, it is imperative that I need some way to hold some data that can be set using asp.net and can be picked up by javascript. Since session can not be used for this purpose, so I need some other way.

Please enlighten me!

Thanks and regards Arunendra

Upvotes: 2

Views: 2225

Answers (1)

ChrisLively
ChrisLively

Reputation: 88044

You can use: Request["fieldname"] to access hidden fields from your .net code. For example:

Request["myfield"] = "some value";

Upvotes: 1

Related Questions