ASP.NET HiddenField值设置 [英] ASP.NET HiddenField Value Setting

查看:520
本文介绍了ASP.NET HiddenField值设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我GOOGLE了这一点,但无法弄清楚如何设置我的隐藏字段的值。我有以下的code:

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"]) %>" />

我只是试图使价值= FILEID 的查询字符串的值。

感谢您的帮助。

推荐答案

尝试:

<asp:HiddenField id="fileId" runat="server" value='<%= Request.QueryString["fileID"] %>' />

相信=操作符暗示的Response.Write你。

Believe the "=" operator implies the Response.Write for you.

只是为了完整起见,你可以设置在codebehind以及,如:

Just for the sake of completeness, you could set it in the codebehind as well, eg

fileId.Value = Request.QueryString["fileID"]

这篇关于ASP.NET HiddenField值设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆