views:

295

answers:

2

Hi

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

+1  A: 

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

Request["myfield"] = "some value";
Chris Lively
HiThanks for such a quick reply, I have tried it right now, as I am using vb.net I put the code like Request("myfield") = "some value", but it is giving a blue line throughout the line, saying "Property item is read only"What to do next ...Thanks and regardsArunendra
arunendra
A: 

Hi

I guess I have found the answer, the best way to handle data between client script and server side is to use cookie.

Thanks Arunendra

arunendra