Hi guys, how am I be able to assign a value to my hidden field control? I have this web service that returns member’s ID and name (e.g. 0001-John dela Vega). In order for me to search for a member, I’m using an autocomplete extender, now, if in case that I found the member I’d like to assign its member id to a hidden field. I ask this because I’d like to change the way my web service return data so instead of displaying the member’s id and name at the same, I’ll just show its member name.
Just use an html hidden input and add runat=“server”. If you are using VS,
you can right click on the control and check run as server control.
<input id="HiddenField1" type="hidden" value="" runat="server" />
protected void Page_Load(object sender, EventArgs e)
{
HiddenField1.Value = "1";
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(HiddenField1.Value);
}