您的位置:首页 > 编程语言 > ASP

asp.net中调用用户控件中的函数并传递参数

2004-09-15 10:43 916 查看
step1: HTML中注册你要的用户控件:
<%@ Register TagPrefix="Module" TagName="Account" Src="../modules/accountmodule.ascx" %>
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 

step2: 建立这个用户控件
<Module:Account id=ModuleAccount runat="server">
</Module:Account>
<asp:Button id="SubmitButton" text="Update Account" runat="server"></asp:Button>
 

step3:
protected AccountModule ModuleAccount;
 

step4: 处理按钮点击事件
        public void SubmitButton_Click(Object sender, EventArgs e)
        {
            //
            // Process the changes to the form
            //
            ModuleAccount.ProcessChanges(para);
        }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐