就像询问这样做的最佳方式一样。我正在检索一个 aspx 页面中的查询字符串值,并且我想将此值分配为隐藏输入字段的值。
<%int productId = 0;
if (Request.QueryString["productId"] != "" && Request.QueryString["productId"] != null)
{
productId = Convert.ToInt32(Request.QueryString["productId"]);
} %>
<input type="hidden" id="hiddenProdIdEditProduct" value=<% productId %> />
因为目前我收到编译错误。