通过updatepanel中的按钮在父页面中上升事件 [英] Rising an event in parent page by a button which is in updatepanel

查看:45
本文介绍了通过updatepanel中的按钮在父页面中上升事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我没有清楚地描述这个问题,但我相信我不知道该如何解释它。



按钮正在上升以下父页面中的事件,但是javascript警报没有触发,你有什么想法吗?

i know that i didn''t describe the problem clearly but believe that i have no idea how should i explain it.

The button is rising the following event in parent page, but the javascript alert doesn''t fire, do you have any idea?

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:Button ID="btnContinue2" runat="server" OnClick="btnContinue2_Click"       Text="Button" />
    </ContentTemplate>
</asp:UpdatePanel>



i放假poi在InsertLocationMap_MyEvent中,所以一切都很好,直到那里但警报框没有弹出,是没有回发的原因?




i put a break point in the InsertLocationMap_MyEvent, so everything is fine until there but the alert box doesn''t popup, is the reason that there is no postback ?

protected void Page_Load(object sender, EventArgs e)
       {
           InsertLocationMap.MyEvent += InsertLocationMap_MyEvent;

       }

       void InsertLocationMap_MyEvent(object sender, usercontrols.cp_user.MyEventArgs e)
       {

           string javaScript = "<script language=JavaScript> alert('wwwoww'); </script>";
          System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "JCall2", javaScript, false);

       }

推荐答案

string javaScript = "<script language="JavaScript"> alert('wwwoww'); </script>";
           System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "JCall2", javaScript, false);



或者你也可以通过




Or you can also do the same by

System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "JCall2", "alert('Hello')", Yes);


您好,



查看此URL



http://www.codeproject.com/Questions/456037/Javascript-not-working-inside-Updatepanel
Hi,

Check this url

http://www.codeproject.com/Questions/456037/Javascript-not-working-inside-Updatepanel


这篇关于通过updatepanel中的按钮在父页面中上升事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆