用户控件:WebUserControl   添加新项-用户控件 .ascx后缀,
            派生.UserControl与页面的父类不是一个  是要嵌在页面里面使用
使用方法:直接设计页面拖到要放置的位置,出现以下两项

<%@ Register src="WUC.ascx" tagname="WUC" tagprefix="uc1" %>

<uc1:WUC ID="WUC1" runat="server" />

路径 4个  
    1:控件路径,image,超链接,指向页面

    第一步:在WUC.ascx页面上:
    <img  src="Image/暴风截图2015102133868160.jpg" runat="server");

         protected void Button1_Click(object sender, EventArgs e)
    {
      

        //.调用Show方法
        string s = TextBox1.Text;
        Show(s);

    }

         5:在实际页面写函数。签名必须和代理类型的一样
        public void Do(string s)
        {

        TextBox1.Text=A;
        }

相关文章: