Postback error 404 when using url rewriting
Monday 23 November 2009
If you discover that your postbacks don't work and return a 404 (page not found) error when you're on a rewritten url, then this is because the postback is looking for a files that doesn't exist, but don't worry, the solution is simple.
Just add the below code to the Page_Load() section of your code, replacing form1 with the ID of your form tags:
-
form1.Action = Request.RawUrl
An example of this in place would be:
-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
form1.Action = Request.RawUrl
-
End Sub
If your form tag is in your Master Page, then add this code to your MasterPage.
|
(2)
|
|
|