jquer ajax
2015-06-26 15:54
453 查看
namespace ENTERPRISE.GeneralFile { /// <summary> /// GeneralFile 的摘要说明 /// </summary> public class GeneralFile : IHttpHandler, System.Web.SessionState.IRequiresSessionState { public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string strPageName = HttpUtility.UrlDecode(context.Request.QueryString["PageName"]); if (strPageName == "COMPANYINFO") { string strCompCode = HttpUtility.UrlDecode(context.Request.QueryString["TRCODE_CO"]); //返回json序列 var enterpriseOinfohead = new EnterpriseEinfoHeadBodyPresenter(null); // var SelectInfo = enterpriseOinfohead.SelectEInfo("TRADE_CO", strCompCode); DataTable dt = enterpriseOinfohead.SelectCompanyInfo(strCompCode); string jsonstr = string.Empty; if(dt!=null) { jsonstr = JsonConvert.SerializeObject(dt, new DataTableConverter()); } context.Response.Write(jsonstr); } } catch (Exception e) { string ss = e.Message; } } public bool IsReusable { get { return true; } } } }
一般处理文件
一般处理文件里访问数据库,如果要获取上下文,或sseion要
引用
System.Web.SessionState.IRequiresSessionState或IReadOnlySessionState
有时不进入后台,注意js里的: contentType: "application/json; charset=utf-8",
相关文章推荐
- Gradle finished with non-zero exit value 1 ic_launcher.png: Original is here. The version qualifie
- setuid和setgid
- UIPickerView的方法和属性
- 50个UI设计资源网站
- CSS3 Media Queries 特性的妙用
- 【Android笔记】org.json.JSONException: No value for
- NGUI减少drawcall 的总结
- iOS三种视图切换 (UITabBarController,UINavigationController,模态窗口)
- 经常遇到build.xml,是干什么用的?
- UITextFiedl 左侧设置小图标 leftview
- Gradle chapter7 Gradle chapter7.Java Quickstart
- iOS 8 Auto Layout界面自动布局系列2-使用Xcode的Interface Builder添加布局约束
- 为何要用request.getContextPath()
- UIScrollView
- Ios 该图显示其出现的相关问题定义UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'
- UINavigationController.navigationBar使用注意事项
- LA 4287 Proving Equivalences(tarjan+强连通缩点)
- iOS开发笔记22--使用XIB自定义一个UIView
- [SoapUI] 循环遍历某个Test Case下的所有Test Step,将Cookie传递给这些Test Step
- CCUI.ListView创建以及用法