zoukankan      html  css  js  c++  java
  • asp.net webform杂记

    context.Response.ContentType = "text/plain";
                string encodeFileName = HttpUtility.UrlEncode("aa.txt");//国际通用防止产生乱码。生成ASCII
                context.Response.AddHeader("Content-Disposition", string.Format("attachment;filename="{0}"", encodeFileName));//在响应头中加上Content-Disposition,attachment表示以附件形式下载.
                context.Response.WriteFile("aa.txt");//输出文件内容

    IsPostBack属性

    //如果该属性的取值为true,那么就是post请求,否则是false那么就是get请求.如果在建好的aspx页面中有一个<from runat="server">那么返回给浏览器的HTML代码中包含一个名称叫__VIEWSTATE的隐藏域。那么单击表单中的提交按钮时,该隐藏域的值会提交到服务端。那么IsPostBack这个属性就是根据__VIEWSTATE隐藏域的来进行判断是get请求还是POST请求。如果能够拿到该隐藏域的值表示post请求否则为get请求.如果前端页面中没有__VIEWSTATE隐藏域那么就不能用IsPostBack属性来判断是get请求还是Post请求.


    获取分页的数据.
    select * from(select *,row_number() over(order by id) as num from UserInfo)as t where num>=1 and num<=10

  • 相关阅读:
    Codeforces Round #226 (Div. 2)
    内存管理
    C/C++ 函数
    Codeforces Round #225 (Div. 2)
    常用链表操作总结
    Codeforces Round #224 (Div. 2)
    Codeforces Round #223 (Div. 2)
    Codeforces Round #222 (Div. 2)
    -树-专题
    Codeforces Round #221 (Div. 2)
  • 原文地址:https://www.cnblogs.com/pangzhixing/p/6261568.html
Copyright © 2011-2022 走看看