Next I tried using the Visual Studio standard html hidden fields control but found out that they cannot be accessed from Code Behind. Since I need to set the hidden field values dynamically at runtime, and not at design time, that's a bit of a problem. The way I used to do it is to use the .NET Literal text control. I would put the Literal control on the page and set its value to the actual html code of "input type=hidden..." during runtime. Not a very efficient method.
After doing some more research, I found a way to dynamically insert hidden fields programmatically through the Page class:
this.Page.ClientScript.RegisterHiddenField(fieldname, fieldvalue)
That solved my problem!
No comments:
Post a Comment