2011-05-05 78 views
0
want to pass session of account id through href.. i tried with 
`href="../Profile/Home.aspx?uid=<% =&Session("AccountId")%>"` 

,但其没有工作..帮我如何通过会话变量的href

+0

试图摆脱&? 还要确保你有会议(“accountId”)的价值 – rlee923 2011-05-05 11:59:36

+0

什么不工作......编译器错误,或者你有其他预期的输出?只是看着你不应该有&后=的代码。 – 2011-05-05 12:00:14

回答

2

尝试:

href="../Profile/Home.aspx?uid=<%= Session["AccountId"] %>" 

你在那里有一个多余的&。同时会话是用[]索引的,而不是()

+0

你不应该使用&和()..感谢它的工作 – Anboo 2011-05-05 12:10:11

+0

这是否反之亦然?例如'href =“../ Profile/Home.aspx?<%Session [”AccountId“] = 29%>'' – william 2011-10-14 05:30:27

+0

@william:您应该能够设置会话变量,但这不是一个好主意。 – Ferruccio 2011-10-14 10:46:35