dynamically build <type="hidden"> elements with code behind
using asp.net:
i have a hash collection and would
like to iterate this collection and
dynamically build <type="hidden"> elements
on the html page and populate them with values
from this collection.
reason: I need to pass these values to another site.
can this be done ?
Re: dynamically build <type="hidden"> elements with code behind
What version of .net are you using (always specify version ;))?
If 1.0/1.1: look at Page.RegisterHiddenField
if 2.0: look at ClientScript.RegisterHiddenField
Re: dynamically build <type="hidden"> elements with code behind
Or you could use a literal and populate that on the page load:
ltlFields.Text = "<input type=""hidden"" name=""item_name"" value=""item_value" & iValue & """ />"
HTH
F