Click here to Skip to main content
15,883,783 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
>

I am hoping that <%=ClipherText%> will be replace with my values, But it's not working... could you explain why?
Posted
Updated 1-Feb-11 7:10am
v2
Comments
byka 1-Feb-11 13:50pm    
in my default.aspx page code behind
...Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ClipherText = "asasaa"
End Sub
...
HTML:
<meta http-equiv="refresh" content="0;url=WebForm1.aspx?ClipherText=<%=ClipherText%> " />
in a browser when 2 page is loaded ...
http://localhost:2957/WebForm1.aspx?ClipherText=<%=ClipherText%>
<%=ClipherText%> -> not replaced with actual value
Yusuf 1-Feb-11 14:24pm    
See my updated answer.
byka 1-Feb-11 14:46pm    
I can't use dymanic meta tag in code behind. I can only add values
byka 1-Feb-11 14:57pm    
because the values from webservice and I can't post it back

1 solution

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 setting ClipherText . 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 of ClipherText in the PageLoad it will work. If so, make sure to set it in the appropriate place.


Updated:

Use Response.AppendHeader

MIDL
ClipherText = "test";
      string qs = Request.QueryString["data"];
      if (!string.IsNullOrEmpty(qs))
        txtText.Text = qs;
      Response.AppendHeader("Refresh", "4; url=test.aspx?data=" + ClipherText);
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900