我有一个来自结果集的变量标记 <%test_variable%>。
我想使用这个 <%=test_variable%> 重定向到一个链接,比如
http://www.helloworld.someurl.com/testUrl?somevariable=<%=test_variable%>&test=ok
如何在 <% %> 标记中执行此操作?例如,
<%=test_variable%>
<%
' I want to redirect the url with the above tag, something like:
Response.Redirect(" http://www.helloworld.someurl.com/testUrl?somevariable=<%=test_variable%>&test=ok")
%>
但我认为我们不能有“嵌套标签”,对吧?
我对 ASP 还很陌生。
最佳答案
<%= %>
是 <% Response.Write(" ... "); %>
的简写:
http://www.helloworld.someurl.com/testUrl?somevariable=<%=test_variable%>&test=ok
经过您的澄清:
<%
Response.Redirect("http://www.helloworld.someurl.com/testUrl?somevariable="
+ test_variable
+ "&test=ok");
%>
关于url - 使用变量的经典 ASP 重定向 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12888515/