摘要:
我们通过继承JsonMediaTypeFormatter定义了如下一个JsonpMediaTypeFormatter类型。它的只读属性Callback代表JavaScript回调函数名称,改属性在构造函数中指定。在重写的方法WriteToStreamAsync中,对于非JSONP调用(回调函数不存在),我们直接调用基类的同名方法对响应对象实施针对JSON的序列化,否则调用WriteToStream方法将对象序列化后的JSON字符串填充到JavaScript回调函数中。using System;using System.Collections.Generic;using System.IO;us 阅读全文
posted @ 2014-03-20 17:52
学亮
阅读(474)
评论(0)
推荐(0)
摘要:
转载地址:http://www.cnblogs.com/donghongtao/p/3611623.html 阅读全文
posted @ 2014-03-20 09:21
学亮
阅读(187)
评论(0)
推荐(0)

浙公网安备 33010602011771号