易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net页面的加载顺序

页面加载顺序如下:
Page.Init
Page.Load
Textbox.TextChanged
Button.Click
Page.PreRender
Page.Unload
在Page.Unload之前,页面就呈现出来了.
page.init只是在页面第一次载入的时候执行,当页面postback后从page.load开始执行.
e.g
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication8._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lbl" runat="server"></asp:Label>
<br />
<asp:Button ID="btn" runat="server" onclick="btn_Click" />
</div>
</form>
</body>
</html>

C#代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication8
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
lbl.Text += "pageload is on.<br />";
else
lbl.Text += "This is not your first.<br />";
}
protected void Page_Init(object sender, EventArgs e)
{
lbl.Text += "pageinit is on.<br />";
}
protected void Page_PreRender(object sender, EventArgs e)
{
lbl.Text += "pageprerender is on.<br />";
}
protected void btn_Click(object sender, EventArgs e)
{
lbl.Text += "button i


相关文档:

asp.net检测网页特性

代码如下:
System.Web.HttpBrowserCapabilities browser = Request.Browser;
string s = "Browser Capabilities\n"
"Type = " + browser.Type ;
"Name = " + browser.Browser ;
"Version = " + browser.Version ;
"Major Version = " + browser.Ma ......

ASP.Net 文件上传大小限制解决方案修改IIS7/7.5配置

IIS 7 默认文件上传大小时30M
要突破这个限制:
1. 修改IIS的applicationhost.config
    打开 %windir%\system32\inetsrv\config\applicationhost.config
     找到: <requestFiltering>节点,
  这个节点默认没有 <requestLimits maxAllowedContentLength="上传 ......

Asp.Net XML操作基类

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Xml;
using System.Text; ......

asp.net treeview 菜单树 链接 展开 折叠

画面:
<asp:HiddenField ID="hfdXuHao" runat="server" />
<asp:TreeView ID="tvMenu" runat="server" CssClass="tvStyle" EnableClientScript="false"
                        & ......

ASP.NET常用的类

系统类
  Type类,Object类,String类, Array类,Console类, Exception类,GC类, MarshalByRefObject类, Math类。
  DateTime结构,Guid 结构,
  ICloneable接口,IComparable接口,IConvertible接口, IDisposable类,
  集合类
  ICollection接口,IComparer接口,IDictionary接口。IDictionaryEnume ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号