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

ASP.NET动态加载用户控件的页面生成过程

  MainPage文件:WebForm1.aspx
    <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="TestMasterPage.WebForm1" enableViewState="False"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>WebForm1</title>
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <asp:PlaceHolder id="PlaceHolder1" runat="server"></asp:PlaceHolder></form>
    </body>
    </HTML>
    WebForm1.aspx.cs
    using System;
    using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls;
    namespace TestMasterPage
    {
    /// <summary>
    /// WebForm1 的摘要说明。
    /// </summary>
    public class WebForm1 : System.Web.UI.Page
    {
    protected System.Web.UI.WebControls.PlaceHolder PlaceHolder1; private void Page_Load(object sender, System.EventArgs e)
    {
    //在此处放置用户代码以初始化页面
    string controlName = "search.ascx";
    UserControl control = (UserControl)LoadControl("~/skins/default/controls/"+ controlName);
    control.ID = "ID_" + controlName; PlaceHolder1.Controls.Add(control); Response.Write("only trace..");
    }
    Web窗体设计器生成的代码Web窗体设计器生成的代码
    override protected void OnInit(EventArgs e)


相关文档:

asp.net中sessionstate不稳定的解决方案

ASP.NET提供了Session对象,从而允许程序员识别、存储和处理同一个浏览器对象对服务器上某个特定网络应用程序的若干次请求的上下文信息。Session对应浏览器与服务器的同一次对话,在浏览器第一请求网络应用程序的某个页面时,服务器会触发Session_onStart事件;在对话超时或者被关闭的时候会触发Session_onEnd 事件。程序员 ......

asp.net的sessionState节点

web.config关于sessionState节点的配置方案,sessionState有四种模式:off,inProc,StateServer,SqlServer。
1、off模式
从字面上就可以看出这个是关闭模式,如果当前页面不需要session的值,为了减少服务器资源,你可以去掉Session的开销。
<sessionState mode="off">或者页面上
<%@ Page EnableSessionState= ......

Asp.Net细节性问题精萃

1.<%=...%>与<%#... %>的区别:
答:<%=...%>是在程序执行时调用,<%#... %>是在DataBind()方法之后被调用
2.控件接收哪些类型数据?
答:接收Bind的控件,一般有DropDownList,DataList,DataGrid,ListBox这些集合性质的控件,而被捆绑的主要是ArrayList(数组),Hashtable(哈稀表),DataView(数据视图 ......

ASP.NET自定义控件事件响应

1.重载protected override bool OnBubbleEvent(object source, EventArgs args)
OnBubbleEvent是控件内包含的控件向外层控件作事件冒泡
-------------------------------------------------------------------------------------------------------------------------------------------
using System;
using System.Co ......

asp.net 对 文件进行压缩 or 解压(zip

asp.net 对 文件进行压缩 or 解压(zip)
/// <summary>
/// 对文件进行(压缩,解压)
/// </summary>
public static class ZIP
{
/// <summary>压缩文件</summary>
/// <param name="filename">filename生成的文件的名称,如:C\123\123.zip</param>
/// <param name="d ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号