url - 使用变量的经典 ASP 重定向 URL

标签 url asp-classic response.redirect

我有一个来自结果集的变量标记 <%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/

相关文章:

php - 如何在php中获取前两个页面的URL

Javascript Slug 也适用于非拉丁字符

asp.net - 查找并删除孤立的网页、图像和其他相关文件

api - 使用 VB/ASP classic 可以向 API 发出 HTTP 请求吗?

c# - 当我使用带有 Silverlight 4.0 的 WebClient 调用 aspx 页面时,无法执行 Response.Redirect

java - 将 Jar-URI 转换为 nio.Path

javascript - 有没有办法在合并主index.html的同时查看(通过本地url)部分html模板?

css - 以模态形式验证

servlets - 如何防止在重定向网址末尾添加 jsessionid

java - 通过 HTTP 重定向传递数据的选项