Response.Redirect problems in .net

All: I am trying to do a simple response.redirect from my code, but the page just post back to itself and sits there blank.

This works perfectly on my machine, but does not work on jodo host. does this have to do with some kind of configuration in jodo host?

if (Page.Isvalid)
{
Response.Redirect("default.aspx");
}

:(

Also my Validation summary with ShowMessagebox property set to true and ShowSummary set to false does not work on jodo host server but works fine on mine.
 
smartblond said:
All: I am trying to do a simple response.redirect from my code, but the page just post back to itself and sits there blank.

This works perfectly on my machine, but does not work on jodo host. does this have to do with some kind of configuration in jodo host?

if (Page.Isvalid)
{
Response.Redirect("default.aspx");
}

:(

Also my Validation summary with ShowMessagebox property set to true and ShowSummary set to false does not work on jodo host server but works fine on mine.

Not sure why it isn't working. I am using the Redirect method on my .Net sites and they work fine. There is, however, a slight difference in the way I am using them. I am using them to redirect requests to my .net domain aliases to my .com urls (mysite.net --> mysite.com). As a result, I'm using the full urls. Although a relative path (default.aspx) should work, you might want to try using the full url ( Response.Redirect("http://www.yoursite.com/default.aspx") ) and see if it works. Again, this is just a shot in the dark...

riley
 
smartblond said:
if (Page.Isvalid)
{
Response.Redirect("default.aspx");
}

Some other thoughts...

Are you sure Page.IsValid=True?
To debug, you might want to add an Else block to your code and show a message on your page that indicates that Page.IsValid=false.

Also have a look at the overload for the Redirect method. There is another signature that includes a boolean to control Response.End. Probably not the solution to your problem here, but it's worth a look.

riley
 
Thanks, but I tried the full url too, it did not work.

I will try but the redirect in the button click event without validation just to see if it works....baffled.
 
smartblond said:
still no luck...exiting confusion mode...switching to panic mode...

I just remembered a validation problem I encountered a few months ago. At jodohost, the javascript files that support the .Net validation controls are stored in a folder named "aspnet_client/system/1_1_4322_0". The version of Studio.Net I was using created links to the javascript files as "aspnet_client/system/1_0_3705". That's why, like your situation, validation worked on my local computer, but not on jodohost. To resolve this problem, simply a upload the aspnet_client/system/xxxxxxx folder and files from your local machine. This will likely solve the problem. Sorry I didn't remember this before...

riley
 
riley said:
I just remembered a validation problem I encountered a few months ago. At jodohost, the javascript files that support the .Net validation controls are stored in a folder named "aspnet_client/system/1_1_4322_0". The version of Studio.Net I was using created links to the javascript files as "aspnet_client/system/1_0_3705". That's why, like your situation, validation worked on my local computer, but not on jodohost. To resolve this problem, simply a upload the aspnet_client/system/xxxxxxx folder and files from your local machine. This will likely solve the problem. Sorry I didn't remember this before...

riley


Aborting panic mode...thanks to riley...

riley thanks a million. I never would have guessed. Meanwhile I used server.transfer to work around my response.redirect problem.... Very inefficient and costly, but I can live with that.
 
smartblond said:
Aborting panic mode...thanks to riley...

riley thanks a million. I never would have guessed. Meanwhile I used server.transfer to work around my response.redirect problem.... Very inefficient and costly, but I can live with that.

I'm thinking that the response.redirect never executed, because Page.IsValid was false. If the browser can't find the javascript files that support the validation controls, your page will run as normal, except validation will never take place. Hence, Page.IsValid will never be set to true. If you have uploaded the required folder/files, your page will probably work fine using response.redirect.

riley
 
You may also find that response.redirect() does not work if Page.Smartnavigation is true. Make it False the line prior to the redirect.
-Dave
 
Please check whether the button click event is submitting two times by anychance.. Just allow response.rediect to happen on single post. (I recently solved this problem of above check... !!)
 
Back
Top