元标记刷新和参数 [英] Meta tag refesh and arguments
本文介绍了元标记刷新和参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将参数传递给meta标签Refersh
I need to pass arguments to meta tag refersh
html...
<meta http-equiv="refresh" content="0;url=hPage.aspx?data=<%=ClipherText%> " />
.net code
Public ClipherText As String = String.Empty
ClipherText =... some values
>
我希望<%=ClipherText%>
将替换为我的值,但是它不起作用...您能解释一下原因吗?
I am hoping that <%=ClipherText%>
will be replace with my values, But it''s not working... could you explain why?
推荐答案
您是什么意思通过它不起作用?它不能正常工作,因为它得到了我设置的值?
如果是更高版本,则在哪里设置ClipherText
.您可以了解页面处理.要理解这一点,必须阅读[ ASP.NET页面生命周期概述 [ ^ ]]
我敢打赌,如果您在PageLoad
中设置ClipherText
的值,它将起作用.如果是这样,请确保将其设置在适当的位置.
已更新:
使用Response.AppendHeader
what do you mean by it is not working? It is not working as getting an error or it not working because it does get the value I set?
If it is the later, then where are you settingClipherText
. You can to understand the page processing. To undertstand that, this is a must read [ASP.NET Page Life Cycle Overview[^]]
I bet if you set the value ofClipherText
in thePageLoad
it will work. If so, make sure to set it in the appropriate place.
Updated:
UseResponse.AppendHeader
ClipherText = "test";
string qs = Request.QueryString["data"];
if (!string.IsNullOrEmpty(qs))
txtText.Text = qs;
Response.AppendHeader("Refresh", "4; url=test.aspx?data=" + ClipherText);
这篇关于元标记刷新和参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文