Try our conversational search powered by Generative AI!

Ladda sida utan Response.Redirect()

Vote:
 
Finns det någon funktion i EPiServer som gör att jag manuellt kan ladda en sida? Jag vill använda en asp:dropdownlist och dess OnSelectedIndexChanged för att navigera till en sida men vill helst inte använda Response.Redirect().
#12285
May 29, 2005 20:32
Vote:
 
Have you considered Server.Transfer or do you mean a completely different way of navigation altogether? Server.Transfer has its uses but whats wrong with Response.Redirect ?
#13972
May 30, 2005 9:30
Vote:
 
Server.Transfer could be a solution but i have discovered some issues with EPiServer. The execution cannot be transfered to a EPiServer page cause it has to go directly to a physical file and not a "virtual" one as EPiServer pages would be; /Page____001.aspx A Server.Transfer to /Page.aspx should work fine. And I ask the same question as John Walsh, what's wrong with Redirect?
#13973
May 30, 2005 11:11
Vote:
 
I believe EPiServer handles /Page____001.aspx and /Page.aspx?id=001 regardless of the mode you selected... try it for yourself...
#13974
May 30, 2005 11:58
Vote:
 
I created one simple page with two buttons, one Redirect and one Transfer. The Redirect button peforms a Response.Redirect to the page "/templates/page.aspx?id=59" and works fine. The Transfer button peforms a Server.Transfer to the page "/templates/page.aspx?id=59" and casts an exception "System.InvalidCastException: Specified cast is not valid". If I change the url to "/templates/page____59.aspx" instead the results are similar. Redirects works fine once again and Transfer fails yet again with the exception "Error executing child request for /templates/page____59.aspx". Maybe I'm doing smething wrong?!
#13975
May 30, 2005 13:12
Vote:
 
Oh I see what you mean - I thought it was complaining because there is no such page as page____58.aspx yet there is a page called page.aspx ... either way - a good thread for future reference :)
#13976
May 30, 2005 13:39
Vote:
 
I have tried Server.Transfer but received the error "EPiServer.Core.EPiServerException: The current template does not match the specified page type file". I would like to avoid Response.Redirect() because it puts unnecessary load on the server by sending a new request. The other reason is that I loose the Viewstate. So I thought EPiServer might have some convenient function letting me do a "redirect" without loosing the Viewstate. Thanks for helping out.
#13977
May 30, 2005 19:23
Vote:
 
What is it you are trying to do? Im curious...
#13978
May 31, 2005 9:02
Vote:
 
Server.Transfer should work fine to do a server-side redirect (no client involved). If you get the "template does not match the specified page type file" exception, it's because the page you are redirecting to cannot be accessed with the aspx file provided in the URL (by design, for security reasons). You can override this behavior by compiling the aspx with the following override: public override void ValidatePageTemplate() { }
#13979
May 31, 2005 9:38
Vote:
 
When I do a Transfer the exception is "Error executing child request". Am I doing something wrong?
#13980
May 31, 2005 15:44
Vote:
 
I'm using a asp:dropdownlist to navigate to pages and thought it would be a good idea using server side forwarding instead of a redirect, mostly to leave the dropdownlist intact. On the other hand this approach might not be useful after all as the viewstate is lost as soon as the user navigates to a page not using the dropdownlist. Dooh! I will just have to save the dropdown settings in personalized data.
#13981
May 31, 2005 20:10
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.