我的耐特人生

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  B/S开发中的一些问题解决方案

B/S开发中的一些问题解决方案
摘要:1 一直在想在asp.net中怎么才能向在java中那样用struts那样做页面请求。 2 3 当然asp.net mvc就是类似struts的东西吧,不过还没来得及学习。 4 5 今天就用ashx来接收页面请求,并调用后台,然后返回数据给前台,用jquer .ajax提交请求,接收ashx返回的数据。 6 7 8 9 例子: 10 11 例子是要实现页面加载时从数据库读取数据,并把数据放到一个下拉列表中。(因为是用ajax,就建html页面就行了,一直不喜欢aspx页面,感觉它太臃肿了。) 12 13 一.准备工作: 14 15 1.建w... 阅读全文
posted @ 2014-04-03 13:53 我的耐特人生 阅读(720) 评论(0) 推荐(0)

摘要:1 1。请求text数据,在success事件中手动解析 2 前台: 3 $.ajax({ 4 type: "post", 5 url: "checkFile.ashx", 6 data: { "filename": "2" }, 7 dataType: "text", 8 success: function (data) { 9 ... 阅读全文
posted @ 2014-03-31 16:01 我的耐特人生 阅读(1042) 评论(0) 推荐(0)

摘要:1 2 3 using System; 4 using System.Web; 5 using System.Text; 6 7 public class Handler : IHttpHandler { 8 9 public void ProcessRequest (HttpContext context) {10 context.Response.ContentType = "text/plain";11 string id = "0";12 //判断提交方式13 if (context.Reques... 阅读全文
posted @ 2014-03-22 14:53 我的耐特人生 阅读(1546) 评论(0) 推荐(0)