Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
正在尝试在ASP.NET中传递参数!解析错误_Asp.net_Parsing - Fatal编程技术网

正在尝试在ASP.NET中传递参数!解析错误

正在尝试在ASP.NET中传递参数!解析错误,asp.net,parsing,Asp.net,Parsing,我试图将一个参数从一个页面传递到另一个页面。我收到解析错误(说明:解析服务此请求所需的资源时出错。请查看以下特定的解析错误详细信息,并适当修改源文件。) 代码如下: <a runat="server" href="~/ProductDetails.aspx?IDProduct=<%# Eval("IDProduct") %>"> <asp:Label Font-Size="16px" ForeColor="Red" runat="server">get

我试图将一个参数从一个页面传递到另一个页面。我收到解析错误(说明:解析服务此请求所需的资源时出错。请查看以下特定的解析错误详细信息,并适当修改源文件。)

代码如下:

<a runat="server" href="~/ProductDetails.aspx?IDProduct=<%# Eval("IDProduct") %>">
   <asp:Label Font-Size="16px" ForeColor="Red" runat="server">get specifications</asp:Label>
</a>

我在
IDProduct=上遇到错误

我应该如何编写它?

处理此类情况的正确方法是在
中生成整个属性值。还要注意更新的引用模式-在属性值周围加单引号,在
内加双引号

href=''
尝试这样做

它与第二种解决方案一起工作。我把一切都写在里面了。感谢you@user1747659,那么我宁愿删除它,而不是欺骗可能找到此帖子的其他人。感谢您的回答虽然这可能是正确的做法,但您应该尝试在回答的同时提供解释。纯代码有时不是自解释的。
href='<%# "~/ProductDetails.aspx?IDProduct=" + Eval("IDProduct") %>'