Using server.transfer

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
6/23/2009 5:21:35 AM
Gravatar
Total Posts 26

Using server.transfer

Hi

I made a server.transfer call to page 'flight-results.aspx', a dynamic page that exists but it fails with message 'Error executing child request for flight-results.aspx.'

I then tried to directly access the page from the browser address box and it worked

Do you have any ideas - I need to be able to programmatically access various pages depending on events

 

 

6/23/2009 6:24:53 AM
Gravatar
Total Posts 55

Re: Using server.transfer

Joe will know better, but it might be that you do not have a problem with mojoPortal per se, but with AJAX or, to be more precise, with AJAX's script manager (which is embedded in mojoPortal in...master page, me thinks). Script Manager doesn't like neither Server.Transfer nor Response.Redirect. Maybe this asp.net forum article will help you circumventing that.

On the other hand you can delete script manager and say good bye to AJAX or add it per feature, but this is not elegant way of doing things, to say the least (and you'll have sync problems with mojoPortal's SVN, if you use it).

Anyway, I'd think twice about (un)necessity of business application's architecture that makes use of extensive redirecting. Do you really need it and why? Can't you use mojoPortal's supporting pages?

Redirecting has a bad taste of GOTO and I'd avoid it at all costs, using it only where necessary (for example in 'pre-default' page that redirects user to standard or mobile page according to user's browser, as in original ASP.NET Portal Starter Kit, if I recall correctly).

6/23/2009 8:54:11 AM
Gravatar
Total Posts 18439

Re: Using server.transfer

I don't see any major problem with using Response.Redirect other than you should be careful not to redirect more than once in a given request or it can negatively impact SEO.

Definitely I think the problem is related to Server.Transfer, and you should probably be using Response.Redirect instead unless you have a very specific reason to use Server.Transfer and understand the implications of using it. I don't think I'm using Server.Transfer anywhere in mojoPortal but I'm using Response.Redirect in lots of places. There is nothing intrinsically evil about redirecting, there are lots of good and appropriate uses for it in my opinion. Very commonly I will use it after post back processing in order to get out of postback so that refreshing the page can't make a duplicate postback. I also redirect to the access denied page if a user has no view permissions and there is various redirect logic for after login or registration or redirecting to the order details after an order is complete, etc, etc.

I'm certainly not aware of any ajax issue related to Response.Redirect as Slaven has suggested, other than you don't want to redirect inside an ajax postback, thats a bad idea and using Server.Transfer inside an ajax postback would also be bad.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.