我的 ASP 页面中有一个会话变量
<% =Session("emplname") %>
如何在 URL 中传递会话变量?会不会类似于
<a href="divProgLog.asp?emp=& emplname &" class="category">Division 1</a>
我的 ASP 页面中有一个会话变量
<% =Session("emplname") %>
如何在 URL 中传递会话变量?会不会类似于
<a href="divProgLog.asp?emp=& emplname &" class="category">Division 1</a>
会话变量的重点不是让您可以在任何页面上访问它而无需手动传递它吗?如果你真的想通过它,你可以做一个 response.write 并像这样写出来。
<a href="divProgLog.asp?emp=<% response.write(Session("emplname")) %>" class="category">Division 1</a>
这会将会话写入查询字符串。希望这可以帮助。
<a href="divProgLog.asp?emp=<%=Session("emplname")%>" class="category">Division 1</a>