2

結果セットからの変数タグ <%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にかなり慣れていません。

4

3 に答える 3

3

<%= %>の省略形です<% 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");
%>
于 2012-10-15T02:27:58.370 に答える
1

あなたの提案をありがとう...

代わりにこれを使用することにしました:

<script type="text/javascript">
   window.location =  "http://www.helloworld.someurl.com/testUrl?somevariable="+<%=test_variable%>+"&test=ok"
</script>
于 2012-10-15T06:42:04.863 に答える
1

あなたのコードは

Response.Redirect("http://www.helloworld.someurl.com/testUrl?somevariable=" & test_variable & "&test=ok")
于 2012-10-15T06:11:23.513 に答える