Last post Oct 23, 2012 01:51 PM by TheTruePerson
Oct 22, 2012 05:33 PM|TheTruePerson|LINK
I have an application and it works like a charm if i don't apply rewrite rule. When i apply a rule (even it gives the same address) pagemethod can not be accessible. I call pagemethod inside the js file. It behaves like refreshing the page and only page_load
event fires. Page.IsPostback returns always false.
By the way if it is related, i'm using master page.
Web config, urlrewrite rule
<rewrite url="~/(.+).aspx" to="~/Forms/$1.aspx" />
<add type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" name="UrlRewriter" />
Js function that trys to reach the pagemethods
PageMethods.displayPages(a, CallSuccess, CallFailed);
public static string displayPages(string a)
These are what i tried and did not work:
1- Added Pagemethods.set_path("/forms/Default.aspx"); to the Js
2- Added same rule to the web.config like (Even doesn't work like that)
<rewrite url="~/Forms/(.+).aspx" to="~/Forms/$1.aspx" />
3- Added the code under master page's Page_load
form1.Action = Context.Request.RawUrl;
Any suggestion would be great. Thank you for your helps.
Oct 22, 2012 07:42 PM|javedwahid|LINK
This might help:
Oct 23, 2012 01:51 PM|TheTruePerson|LINK
Thank you for your answer. However, this didn't help.
The thing that I can't understand, even i reroute the page itself, it doesn't call WebMethod. It calls everytime Page_Load. I couldn't figure out what causes this.