Reputation: 17
I have a strange problem.
Page.IsPostBack returns always false after url Rewriting.
I am using a link that directs to a function, like,
<a href="#" onclick="return getHelp('4','P')">
This goes to js file and js calls below pagemethod.
<script>
function getHelp(id, type) {
PageMethods.displayHelp(id, type, CallSuccess, CallFailed);
}
</script>
This is the pageMethod that i try to access from javascript,
[System.Web.Services.WebMethod]
public static string displayHelp(string id, string type)
{
response.writeline(id+type);
}
If i don't use urlrewriting it works perfect. However, if i use urlrewriting, the postback could not recognized.
Any help would be appreciated
Upvotes: 0
Views: 319
Reputation: 22568
It is not apparent to me from your code but if you are simply reloading the page via JavaScript, the postback model will be broken.
Page.ClientScript.GetPostBackEventReference()
to get a client side postback method.
Upvotes: 2