PageMethod 和 URl 重写 [英] PageMethod and URl Rewrite

查看:24
本文介绍了PageMethod 和 URl 重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 pagemethod + url 重写有问题.

I am having issue with my pagemethod + url rewrite.

使用常规 URL 时:http://myweb.com/mypages/abc.aspx

When using regular URL: http://myweb.com/mypages/abc.aspx

调用 PageMethod 工作正常.

call to the PageMethod works fine.

但是当我使用友好的 URL 时:http://myweb.com/abc 它确实有效.虽然没有错误.

But when i use a friendly URL : http://myweb.com/abc it does work. No error though.

任何帮助将不胜感激.

推荐答案

您可以使用 PageMethods.set_path 方法从 javascript 设置到 aspx 文件的正确路径:

You can set the right path to the aspx file from javascript using the PageMethods.set_path method:

<script type="text/javascript">
   PageMethods.set_path("/mypages/abc.aspx");
</script>

答案摘自asp.net官方论坛:

The answer is taken from the official asp.net forum:

http://forums.asp.net/p/1599846/4066920.aspx#4066920

这篇关于PageMethod 和 URl 重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆