惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
D
Docker
Vercel News
Vercel News
IT之家
IT之家
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
腾讯CDC
Google DeepMind News
Google DeepMind News
I
InfoQ
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
博客园 - Franky
The Cloudflare Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
T
Tenable Blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
Security Latest
Security Latest
H
Hackread – Cybersecurity News, Data Breaches, AI and More
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 聂微东
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google Online Security Blog
Google Online Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
U
Unit 42
The Hacker News
The Hacker News
Martin Fowler
Martin Fowler
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
F
Full Disclosure
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
Project Zero
Project Zero

博客园 - silverlightfans

sql server 获取数据库中每个表的磁盘占用情况 扩招的后果(搞笑版) 数据仓库构建实施方法及步骤(转载) treeview非xml数据源绑定 VS 2008 JavaScript Intellisense for Silverlight google 的百毒视频,巨搞笑啊,不知道是不是真的 国际支付平台又添新成员Amazon FPS asp.net 客户端回调功能的实现机制探讨(响应部分及可能的优化) asp.net 客户端回调功能的实现机制探讨(请求部分) 黎巴嫩的一位mvp写的一篇文章 关于为什么web service 构造函数只能是无参数构造函数问题的解答 Silverlight:动态从服务器端获取XAML来绘制前台 javascript附加事件,ff 和 ie 网易的高级提示功能 PageMethods未定义 的解决 微软为google修改Vista 最好不要使用百分比宽高来创建silverlight Silverlight:一个IE浏览器 利用Tiny Framework 从托管代码中直接操作页面的 DOM元素
asp.net ajax 包装得似乎有些过分
silverlightfans · 2007-06-25 · via 博客园 - silverlightfans

玩了玩asp.net ajax的 PageMethod,结果在处理异常的时候,我用fiddler跟踪到的数据显示当服务器端产生了一个异常的话,返回一个js对象:
{"Message":"wrong!ok!","StackTrace":"   在 _Default.Send(String x)","ExceptionType":"System.Exception"};

当我想在错误处理回调方法上来获得这个对象的Message属性的时候,却获得不到,按照官方的意思是只能通过这种办法获得:
function OnGetAthletesByServiceError(response)
{
    alert("OnError - Exception");
    alert(response.get_message());
    alert(response.get_stackTrace());
    alert(response.get_exceptionType());
}

明显,从服务器端返回的对象已经在客户端再次被封装,但是作用却是基本一样的,难道这样的处理就是为的更加面向对象,让暴露在外面的只是公共方法而不是未受保护的字段?

如需对asp.net ajax PageMethod有更多详细了解,可以点击这:http://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx

posted on 2007-06-25 13:26  silverlightfans  阅读(388)  评论()    收藏  举报