摘要: CreateCaseInsensitiveHashtable()创建 Hashtable 类具有默认初始容量的不区分大小写的新实例。CreateCaseInsensitiveHashtable(IDictionary)将项从指定字典复制到 Hashtable 类的不区分大小写的新实例,该实例具有与复制项的数量相同的初始容量。CreateCaseInsensitiveHashtable(Int32)创建 Hashtable 类具有指定初始容量的不区分大小写的新实例。CreateCaseInsensitiveSortedList创建 SortedList 类的新实例,该实例忽略字符串的大小写。Eq 阅读全文
posted @ 2013-09-23 10:16 fulai_xy 阅读(430) 评论(0) 推荐(1) 编辑
摘要: Request.UrlReferrer可以获取客户端上次请求的url的有关信息。 这样我们就可以通过这个属性返回到“上一页”,示例如下1. 首先在Page_load中获得并储存该信息Page_load(object obj,EventArgs e) { if(!IsPostBack){ if(Request.UrlReferrer!=null)// {ViewState["UrlReferrer"]=Request.UrlReferrer.ToString();}} }l 页面回发后会改变Request.UrlReferrer,将其指向当前页面,所以需要进行判断:只有在第一 阅读全文
posted @ 2013-09-22 17:28 fulai_xy 阅读(388) 评论(0) 推荐(1) 编辑
摘要: 比如建立一个名为aspcn,值为灌水小鱼的cookieHttpCookie cookie = new HttpCookie["aspcn"];cookie.Value = "灌水小鱼";Response.AppendCookie(cookie);取出Cookie值也很简单HttpCookie cookie = Request.Cookies["aspcn"];cookieValue = cookie.Value;在一个Cookie中储存多个信息,那也没有问题。比如在名为aspcn的cookie下加多个信息HttpCookie cook 阅读全文
posted @ 2013-09-22 10:46 fulai_xy 阅读(319) 评论(1) 推荐(0) 编辑
摘要: 把localhost换成IP或域名1407为端口号给你一个例子:测试的url地址是, 结果如下: Request.ApplicationPath: /testweb Request.CurrentExecutionFilePath: /testweb/default.aspx Request.FilePath: /testweb/default.aspx Request.Path: /testweb/default.aspx Request.PathInfo: Request.PhysicalApplicationPath: E:\WWW\testweb\ Request.PhysicalPa 阅读全文
posted @ 2013-09-22 09:44 fulai_xy 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 在编译__doPostBack()函数时出现了一个问题,问题描述如下:回发或回调参数无效。在配置中使用 可能出现的问题: 回发或回调参数无效。在配置中使用 或在页面中使用 启用了事件验证。出于安全目的,此功能验证回发或回调事件的参数是否来源于最初呈现这些事件的服务器控件。如果数据有效并且是预期的,则使用ClientScriptManager.RegisterForEventValidation 方法来注册回发或回调数据以进行验证。解决的方法主要有如下几种,要针对自己的情况作出选择:1、在页面的 中添加 EnableEventValidation="false" 就可以了。( 阅读全文
posted @ 2013-09-18 16:44 fulai_xy 阅读(640) 评论(0) 推荐(0) 编辑
摘要: 要理解__doPostback函数的用法,首先我们要理解Asp.net 中服务端控件事件是如何触发的。Asp.net 中在客户端触发服务端事件分为三种情况:一. WebControls中的Button 和HtmlControls中的Type为submit的HtmlInputButton这两种按钮最终到客户端的表现形式为: ,这是Form表单的提交按钮,点击以后会作为参数发送到服务端,参数是这样的: 控件的name属性=控件的value值,对应上面的例子就是:Submit1= Submit。 服务端会根据接收到的控件的name属性的这个key来得知是这个按钮被点击了,从而在服务端触发这个按钮的点 阅读全文
posted @ 2013-09-18 16:40 fulai_xy 阅读(6617) 评论(0) 推荐(0) 编辑
摘要: Asp.net控件开发学习笔记-控件开发基础(一)http://www.cnblogs.com/CareySon/archive/2009/09/30/1576984.htmlAsp.net控件开发学习笔记-控件开发基础(二)http://www.cnblogs.com/CareySon/archive/2009/09/30/1577068.htmlAsp.net控件开发学习笔记-控件开发基础(三)http://www.cnblogs.com/CareySon/archive/2009/10/02/1577402.html Asp.net控件开发学习笔记(四)---Asp.net... 阅读全文
posted @ 2013-09-18 13:59 fulai_xy 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Obsolete 属性将某个程序实体标记为一个建议不再使用的实体。每次使用被标记为已过时的实体时,随后将生成警告或错误,这取决于属性是如何配置的。例如:复制代码 [System.Obsolete("use class B")]class A{ public void Method() { }}class B{ [System.Obsolete("use NewMethod", true)] public void OldMethod() { } public void NewMethod() { }}在此例中,Obsolete 属性应用于类 A 和方法 阅读全文
posted @ 2013-09-18 13:24 fulai_xy 阅读(177) 评论(0) 推荐(0) 编辑
摘要: C#高级应用-反射动态调用类的成员范例代码如下://---------------------测试类------------------ using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace InvokeMemberDemo{ /// /// 有关用户信息的相关类 ///class UserInfo { //私有字段及公有属性privateint carID =0; publicint CarID ... 阅读全文
posted @ 2013-09-04 17:18 fulai_xy 阅读(172) 评论(0) 推荐(0) 编辑
摘要: //Type p = Type.GetType("TypeTry.TestClass"); //Type pp = Type.GetType("WebApplication2.Person"); Assembly assembly = Assembly.Load("TypeTry"); //foreach (Type aa in assembly.GetTypes()) //{ // Response.Write(aa.Name); //} Type p = assembly.GetType("TypeTry.TestCla 阅读全文
posted @ 2013-09-03 16:37 fulai_xy 阅读(180) 评论(0) 推荐(0) 编辑