Technical support This forum is closed.
Version 1.x > Technical support > Postbacks on url-rewritten pages View modes: 
User avatar
Member
Member
cpaul - 4/15/2005 11:57:13 PM
   
Postbacks on url-rewritten pages
I had a shopping cart control on a page, and whenever it would postback, the URL would change to the true URL, which I thought was confusing for the end user. I'd like the same URL to be visible after completing the postback.

I couldn't find anything in the docs, and didn't want to mess around with manually rewriting the URLs and step on the UrlRewriter's feet, so I used javascript to change the form action (something I'm not fond of having to do).

<SCRIPT>
function makeFriendlyAction() {
var form = document.forms["form1"];
form.action = '<%=ResolveUrl("~"+OpenBio.Web.App.Website.Functions.GetAliasPath()+"/default.aspx")%>';
}
</SCRIPT>
<body bgColor="white" onload="makeFriendlyAction()">


And this works as expected, but is there a cleaner way to do this?

User avatar
Guest
admin - 4/23/2005 6:00:44 PM
   
Re: Postbacks on url-rewritten pages
Hi Chip,

Thank you for your post. Unfortunately, we do not know about any other way how to keep the URL friendly :(

Best Regards,

User avatar
Member
Member
thalter - 8/5/2005 9:37:01 PM
   
Re: Postbacks on url-rewritten pages
Create your own form class that does not render an "action" attribute. This way, the form will always post back to itself at the rewritten URL. Only problem is that some browsers don't handle actionless forms when there is no document name (such as http://kentico.com/, as opposed to http://kentico.com/default.aspx).


For more info, go here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp

Scroll down about 3/4 of the way to "Actionless Forms"

User avatar
Guest
admin - 8/5/2005 10:22:14 PM
   
Re: Postbacks on url-rewritten pages
Thank you for your message. Version 1.7 that will be released in a few days will solve this issue globally using an output filter that fixes the action value.

Best Regards,