Click here to Skip to main content
15,887,881 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want a web application where if a user enters a removed or error page,he should be shown the page some time(say 5 sec) and the page should automatically redirect to another valid page.Is there any built in functions in C# for this?Please answer this...

Thanks and Regards,
S.M.Naresh.
Posted

1 solution

Hi Naresh,

you can achieve this by adding a meta tag in the header section of your HTML output:

<meta http-equiv="refresh" content="10; URL=http://xxx.com/wherever.aspx"></meta>


Addition:

This should be added to the error page and since you want this for 404 errors also, you'll have to create a customized Error page.

Cheers

Manfred
 
Share this answer
 
v2
Comments
S.M.Naresh 15-Nov-10 4:16am    
Hi Manfred,
The <meta> tag is working but, the url section points to an external website..how to redirect to a page in same web application?
Manfred Rudolf Bihy 15-Nov-10 4:20am    
Well the url in my example is made up. You'll have to supply an url that points to your web application like this:
http://yourhost/yourwebapp/yourpage.aspx
or since you're already in your web application use a relative path
./wherever.aspx
S.M.Naresh 15-Nov-10 4:41am    
Thank you Manfred..it worked!!
Manfred Rudolf Bihy 15-Nov-10 4:43am    
Glad I could help. (You can vote if you want to show your appreciation)

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