|
|
Rank: Enthusiast
Joined: 9/7/2007 Posts: 18 Location: UK
|
I have created an ASP.net wizard usercontrol, which has a few steps. As you step through the wizard the page URL changes from: http://server.domain.com/pageNameto: http://server.domain.com/%2fpageNameThe "%2f" is the URL encoded value for "/" Also it gets changed to: http://server.domain.com/default.aspx?umbPage=%2fpageNameWhich works OK while you are progressing forwards, though it is not pretty. But if you use the previous button you get a 404, page not found. Do you know of a way to keep the URL as "/pageName"? Has anyone else experienced and solved this problem? Cheers Richard
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 629 Location: Preston, UK
|
Just to update! This looks like a wizard control with ajax update panel issue. So when ajax panel is removed the url stuff works.
Has anyone come across this issue before which isnt really an umbraco issue!
Regards
Ismail
Level 2 certified. If it aint broke dont fix.
|
|
Rank: Enthusiast
Joined: 9/7/2007 Posts: 18 Location: UK
|
When asp:UpdatePanel is used, and a control does an Ajax call the form's action is not being HTML decoded, so /directory/pageName is written as %2fdirectory%2fpageName. I would expect that this then causes Umbraco a problem in not being able to work out which page should process the post back.
Richard
|
|
Rank: Enthusiast
Joined: 9/7/2007 Posts: 18 Location: UK
|
The fix I have implemented is to include some JavaScript and JQuery to HTML decode the form's action. This relies on JavaScript being turned on on the client, so if there is another method of resolving this that would be appreciated. Richard I created a JavaScript file containing the following code and called at the start of the wizard. Code: (function($) { var theAction;
// Get the action, e.g. %2fdirectory%2fpageName theAction = $("form").attr("action");
// Replace all (using the g flag) of %2f with "/" theAction = theAction.replace(/%2f/g, "/"); // Write this text back to the form's action $("form").attr({action: theAction}); })(jQuery);
|
|
Rank: Fanatic
Joined: 7/20/2006 Posts: 256 Location: Boston, Massachusetts
|
Hi Richard,
I'm having the same issue you described using an Ajax UpdatePanel (.net 2.0) in my control. I'm really not that familiar w/ javascript & jquery - could you show me a snippet of how I'd call your work around from my control. Do I need to include a js library as well?
Thanks, Tom
|
|
|
Guest |