I have googled this, but can't figure out how to set the value of my hidden field. I have the following code:
<asp:HiddenField id="fileId" runat="server" value="<%# Response.Write(Request.QueryString["fileID"]) %>" />
I am just trying to make the value = the value of fileID
in the query string.
Thanks for your help.
Try:
<asp:HiddenField id="fileId" runat="server" value='<%= Request.QueryString["fileID"] %>' />
Believe the "=" operator implies the Response.Write for you.
Just for the sake of completeness, you could set it in the codebehind as well, eg
fileId.Value = Request.QueryString["fileID"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With