I recently hacked into web forms, seeing if one of my (routing) projects could be used with it. So far it has been nothing more than a nuisance, but I am almost to the point that it "works"
I made the page "Test.aspx". In Global.asax, I made it so that it /Test.aspx /test instead of /Test.aspx . It works completely. It goes off the user page class. The custom class finds the HtmlForms on the page and overwrites its Action attribute with the corresponding value: /test .
Now I hit a huge brick wall called Viewstate and ASP.Net. I added the Test.aspx button with the OnClick handler. I can click a button and the page will be back, etc., but the OnClick event will not happen. I donβt understand how simply changing the URL can break the viewstate this way, since I didnβt have the impression that the Viewstate would track such a thing. In addition, IsPostback will be false, although HttpMethod == true. That makes no sense to me.
In addition, I turned off EventValidation because I realized that this would be a problem, but this problem persists.
How can I make viewstate and postbacks work as usual when rewriting URLs?
(Please note: my URL rewrite form does all internal rewriting, the HTTP address is never redirected to the user)
source share