[英]Passing through value in href
如何在ASP.NET工作的XAML中通过href标记传递值?
我已经试过了:
<a href='profile.aspx?ID=<%#HttpContext.Current.Session["id"]%>'>Profile</a>
但是,URL显示为"profile.aspx?ID="
我究竟做错了什么?
为了使您的代码块可以与#
一起正常使用,您需要调用DataBind
方法。 另外,您可以将代码块与=
,它应该可以正常工作:-
<a href='profile.aspx?ID=<%= HttpContext.Current.Session["id"]%>'>Profile</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.