This project is read-only.

Redirecting problem?

Topics: ASP.NET 2.0, Business Logic Layer, Controls
Nov 8, 2008 at 12:43 PM
Edited Nov 8, 2008 at 7:28 PM
First, BlogEngine is fantastic! Thanks so much!

I'm a nubie, but have somehow managed to integrate the BlogEngine into a simple 2.0 site I had already made.

Since I already had my main page called 'Default.aspx', I changed the BlogEngine main page to 'BlogTrial.aspx'.

It all works perfectly, except....

After logging in, it returns to my Default.aspx page instead of BlogTrial.aspx page. Same thing happens after deleting a post (i.e. goes back to my Default.aspx page).

I've spent the last 18 hours looking for 'reponse.redirects' etc trying to find out where in the code it tells the site to return to Default.aspx after these processes are completed, to no avail. Is there somewhere in the settings that directs it to go back to the default.aspx page?

I would be hugely grateful if someone could point me in the right direction.

Many thanks

Nov 9, 2008 at 11:28 AM
Default.aspx is referenced in many places. Use you IDE (Visual Studio?) and do a search through the entire project for "default.aspx" and you will will see what I mean. Specifically the entries you are referring to are located in the login.aspx.cs file as "Response.Redirect(BlogEngine.Core.Utils.RelativeWebRoot, true);" and in other places as "Response.Redirect("Default.aspx");"

Be careful changing them and make sure you can revert easily if something goes wrong. MAKE A BACKUP. Hope that helps some.


Nov 9, 2008 at 12:54 PM
Thanks very much for your reply Taylex

Yes, I have searched through the project (several times) for 'default.aspx' and even just 'default' and changed most of them but haven't been able to find the determining default.aspx. Changing the 'Response.Redirect(BlogEngine.Core.Utils.RelativeWebRoot, true)' on the login.aspx.cs file to 'Response.Redirect("BlogTrial.aspx")' doesn't seem to make a difference. Where does it store the BlogEngine.Core.Utils.RelativeWebRoot? I don't really understand what this is or what it does. Even getting rid of these lines seems to make absolutely no difference.

Thanks again,
Nov 9, 2008 at 3:35 PM
I've finally figured out that debugging wasn't hitting the 'Response.Redirect(BlogEngine.Core.Utils.RelativeWebRoot, true)' line because I was logging in as an administrator, not editor. I managed to fix my problem by replacing the whole 'if' statement with 'Response.Redirect(BlogEngine.Core.Utils.RelativeWebRoot + "BlogTrial.aspx", true);' . Still not sure why it was automatically going back to the Default page after logging in as an adminitrator though as it wasn't hitting any of the Redirects to RelativeWebRoot that I could see........

Many thanks again for your help
Nov 9, 2008 at 6:25 PM
Sorry to be such nubie, but I've spent days on this and I'm going bananas!

After deleting a post, the website keeps redirecting to (my) Default.aspx page. I'd really like to control this and instead send it to my BlogTrial.aspx page instead. Can anyone point me to where the code is for this? I'm confused because the PostView.ascx page doesn't have a .cs page attached with a Reponse.Redirect.

Any help would be hugely appreciated.