Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a page called DoneRequestToRecruitAuth.aspx and it loads perfectly when it has been set as start page in asp.net

But redirect this page from homepage.aspx to DoneRequestToRecruitAuth.aspx using

C#
Response.Redirect("DoneRequestToRecruitAuth.aspx");


I am getting an error

HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Why it's not loading if it redirect from response.redirect and I have other pages in same project which loads fine.
Posted
Comments
Sibasisjena 8-Jan-14 5:09am    
got your problem. The calling page and called page are not in same directory.
Sibasisjena 8-Jan-14 5:09am    
Please give your folder structure of both the aspx pages.
sathish kumar 8-Jan-14 5:17am    
when you said folder structure, I'm not sure what to give
Sibasisjena 8-Jan-14 5:21am    
path of both the files like
Ex:
C:\Users\sibasisj\Desktop\Admin\admin.aspx
sathish kumar 8-Jan-14 5:25am    
C:\uptodate code\IT_Req_2_Rec\DoneRequestToRecruitAuth.aspx

it may possible that your home page is in the roor structure but the other page is inside some other folder than the root structure.

try something



Response.Redirect("~/Foldername/DoneRequestToRecruitAuth.aspx");

OR

Response.Redirect("~/DoneRequestToRecruitAuth.aspx");
 
Share this answer
 
Comments
sathish kumar 8-Jan-14 5:38am    
No sorry It's not working
ZurdoDev 8-Jan-14 10:00am    
This is the correct answer. You need to provide the proper path. That is what a 404 error means, it can't find the page you are trying to go to. You have to put in a proper path.
Quote:
Thanks for your offer Tadit, I have changed the requirement and it's okay for me now. :)
Just adding to move it from Unanswered list. :)
 
Share this answer
 

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