[英]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.