javascript - Solved: context.RewritePath and jquery ajax not calling webmethod -
javascript - Solved: context.RewritePath and jquery ajax not calling webmethod -
question background:- question part of other question, posted new question create things easy understand, main question link this:- link , in link can find total brief info of project , solutions loading css context.rewritepath issue.
in project, wrote context.rewritepath in global.asax redirect user request different location without changing addressbar address.
issue : without context.rewritepath jquery ajax working perfectly;calling webmethod response in json. when using context.rewritepath jquery ajax response html instead of json.
here live links:
jasbir.bhinderblink.com
bhinderblink.com/users/jasbir/default.aspx
both links calling same page server. first context.rewritepath , sec without context.rewritepath. demo test, on page can click top sec or 3rd text box , give type box save info database.
you notice first link generates error , if go firebug java helloworld post response see returning html instead of json, sec link returns json data
i googled lot not got much success
let me know if need more detail or code, thanks
you can seek returning right mime type. also, utilize total url helloworld in ajax post url.
url: "/users/jasbir/default.aspx/helloworld",
update:
your problem, based upon linked question losing /helloworld portion of request when rewrite performed.
if directory.exists(server.mappath("~/users/" & parameters(i))) context.rewritepath("/users/" & parameters(i) & httpcontext.current.request.path, false) homecoming else context.rewritepath("/error.aspx") homecoming end if
javascript jquery asp.net asp.net-ajax global
Comments
Post a Comment