Last post Apr 13, 2005 03:28 PM by haidar_bilal
Apr 12, 2005 05:26 AM|haidar_bilal|LINK
Apr 13, 2005 12:54 AM|ElusiveByte|LINK
The problem lies in a combination of things.
1. The action attribute of the HtmlForm control is determined by removing all the path context from the current url. So if you are on /products/test.aspx, the action Attribute will say "test.aspx".
2. The HtmlForm control has no idea you rewrote the url. It always uses the physical file path.
So if you have /products/goodstuff/foobar.aspx as the friendly url the client sees, but you rewrote it to
/products/realpage.aspx, the action attribute will only say "realpage.aspx", so when yo post-back, your client is posting to
/products/goodstuff/realpage.aspx which doesn't exist, and they get a 404 error.
Scott Mitchell mentions in
this article that you can make your own form class that inherits HtmlForm, then completely remove the action attribute in the RenderAttributes method. It's not a perfect solution though, because there are internal methods and properties that you cannot
access in your subclass. So you will be unable to completely reproduce the functionality that that method normally has.
- Todd Moon
Apr 13, 2005 07:59 AM|haidar_bilal|LINK
Apr 13, 2005 09:15 AM|ElusiveByte|LINK
Apr 13, 2005 12:40 PM|haidar_bilal|LINK
Apr 13, 2005 03:28 PM|haidar_bilal|LINK