Last post Jun 11, 2019 02:23 AM by Wei Zhang
Jun 10, 2019 08:06 PM|drewsmith140971|LINK
I have a redirect from the default page to another page after a few seconds. If on the second page there is no gridview to display and am using another response to redirect back to the default page.
The command on the second page back to the default page is : Response.AddHeader("Refresh", "3; url=Default.aspx")
On the address page the address is written as Default.aspx, 5;URL=Default.aspx and get the following error :
Jun 11, 2019 02:23 AM|Wei Zhang|LINK
According to your description, I have made a sample here. I think you meet this error because
these two aspx page are not in the same folder.
When you use code as below:
Response.AddHeader("Refresh", "3; url=Default.aspx")
url represents the relative path of the file.So if you want to directly use Default.aspx, this page must be in the same folder.
Else if you don't want to change the location of file , you could define url attribute.
For example, I create a w1.aspx in a folder and I create a w3 aspx outside the folder.You could when I want redirect from w1 to w3. I could write as below in my w1.aspx:
Response.AddHeader("Refresh", "3; url=../w3.aspx");
Here is the link about how to define relative path ,I hope it could help you.