ITPub博客

首页 > > > 动态加载ascx后,点击ascx中的一个button控件

动态加载ascx后,点击ascx中的一个button控件

作者:choubou 时间:2019-09-17 14:40:19 0 删除 编辑

动态加载ascx后,点击ascx中的一个button控件,页面被刷新,而且执行不了button控件中的代码


//aspx中设定占位符
 <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>


//aspx中动态加载ascx

  protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
       PlaceHolder1.Controls.Add(Page.LoadControl("center_1.ascx"));
    }


//center_1.ascx 中Center_IM_Bu按键的代码
protected void Center_IM_Bu_Click(object sender, ImageClickEventArgs e)
    {
        
    Page.ClientScript.RegisterStartup


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4548/viewspace-3135089/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: java好学吗.??
请登录后发表评论 登录
全部评论

注册时间:2019-10-08

  • 博文量
    175
  • 访问量
    10713