随笔分类 - ASP.NET
ASP.NET 学习总结
摘要:1.实现IDisposable 接口的类实现Dispose 方法; 2.using(ATest t=new ATest()){}结束时自动调用Dispose();相当于try{} catch{} ,catch调用Dispose();
阅读全文
摘要:<asp:Repeater ID="RepeaterShow" runat="server" OnItemCommand="RepeaterShow_ItemCommand"> <%--OnItemCommand="Repeater1_ItemCommand"--%> <ItemTemplate>
阅读全文
摘要:protected void Page_Load(object sender, EventArgs e) { //string g=Request.Url.ToString(); //Response.Write(g ); string[] str = { "Ab","B1db","a7sjdkf"
阅读全文
摘要:.ashx: string _delfile = DTRequest.GetString("DelFilePath"); HttpPostedFile _upfile = context.Request.Files["Filedata"]; bool _iswater = false; //默认不打
阅读全文
摘要:public static string GetJson(string url) { string res = ""; HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url); req.Method = "GET"; using
阅读全文
摘要:1.Error List;2.Output: Debug.WriteLine() Trace.WriteLine():诊断输出Debug.WriteLine("Added 1 to i","MyFunc");//第二个参数为类别,可不写。输出:MyFunc:Added 1 to i条件Output:
阅读全文
摘要:string [] cities={"London","Amsterdam","San Fran","a"}; GridView1.DataSource=from city in cites where city.length>4 orderby city select city.ToUpper()
阅读全文
摘要:前台: <asp:DropDownList ID="Manager" AutoPostBack="true" runat="server" OnSelectedIndexChanged="DropDownList4_SelectedIndexChanged1"></asp:DropDownList>
阅读全文
摘要://数据绑定string strXml="<xml><m><a></a><b></b></m><m><a></a><b></b></m></xml>";DataSet ds=new DataSet();Stream stream=new MemoryStream(Encoding.Default.G
阅读全文
摘要:.Net 框架: 是由微软开发,一个致力于敏捷软件开发(Agile softwaredevelopment)、快速应用开发(Rapidapplication development)、平台无关性和网络透明化的软件开发平台。 三个主要组成部分: CLR、服务框架(Services Framework:
阅读全文
摘要://添加Cookie //第一种添加Cookie方法 HttpCookie myCookie = new HttpCookie("userrole"); myCookie.Values["a"] = "a"; myCookie.Values["b"] = "b"; myCookie.Expires.
阅读全文
摘要:HttpFileCollection files = HttpContext.Current.Request.Files;如果 files返回的结果总是不对解决:必须为file控件添加Name属性 document.getElementById('FileList').insertAdjacent...
阅读全文
摘要:ASP.net程序是服务器控制的,你打开的网页只是服务器线程池中一个线程的运行结果,所以你即使关闭了网页,应用程序也不会关闭的1.Request.QueryString["id"] 只能读取通过地址栏参数传递过来的名为id的参数2.Request["id"]是一个复合功能读取函数。3.它的优先级顺序...
阅读全文
摘要:using System.Data;using System.Data.OleDb;using System.Data.SqlClient;using System.Linq;using System.Web;/// /// ExcellToDataBase 的摘要说明/// public clas...
阅读全文
摘要:DataAdapterSqlDataAdapter内部通过SqlDataReader获取数据 SqlDataAdapter da = new SqlDataAdapter(); DataSet dataset=new DataSet(); dataset.Tables.A...
阅读全文
浙公网安备 33010602011771号