0
如何在我的ASP.NET工作的XAML中通过href标记传递值?
我已经试过这样:传递href中的值
<a href='profile.aspx?ID=<%#HttpContext.Current.Session["id"]%>'>Profile</a>
但是网址显示像"profile.aspx?ID="
我在做什么错?
如何在我的ASP.NET工作的XAML中通过href标记传递值?
我已经试过这样:传递href中的值
<a href='profile.aspx?ID=<%#HttpContext.Current.Session["id"]%>'>Profile</a>
但是网址显示像"profile.aspx?ID="
我在做什么错?
为使您的代码块能够正常使用#
,您需要调用DataBind
方法。或者,您可以使用=
的代码块,它应该可以正常工作: -
<a href='profile.aspx?ID=<%= HttpContext.Current.Session["id"]%>'>Profile</a>
您是否已调试以查看变量是否传递给它? – Quill
@Quill是的变量是44 – c0mrade
您的会话有没有超时? – Quill