介绍 |
本例采用asp.net C#+ jquery +ajax的实现 本例主要用aspx文件请求 还可以用ashx处理 ajax返回类型也很多 如: dataType: "xml",
dataType: "json", 其实可区分为三种
Text:“text/plain“; XML:“application/xml“; JSON:“application/json“.
dataType为xml的时候,response.Write(string)中的字符串一定要符合xml的格式, 为json的时候,response.Write(string)中的字符串一定要符合json的格式为否则会出现解析错误, 这个和aspx页是一样的。
如果要使用session的话,在handler的代码中添加System.Web.SessionState的引用, 并让这个handler继承IRequiresSessionState接口,一定要继承这个接口,否则会出错的。
以上本人简单总结 只有用使用到它才能感觉到很奇妙
主要jquery ajax静态页面查询添加 数据无刷新效果 对初学者很有帮助 如有不懂地方可以加我QQ 或者博客
|