0

ASPxPopupControl があり、コールバック関数で JavaScript 関数を呼び出したい

<script type="text/javascript">
    function ShowAlert() {
      alert('Display Message Alert');
    }   
</script>


protected void ASPxPopupControl_WindowCallback(object source, DevExpress.Web.ASPxPopupControl.PopupWindowCallbackArgs e) {

    I want to Call ShowAlert() javascript function from here
}

I tried this code but it only works on button click event

Page.ClientScript.RegisterStartupScript(GetType(), "MyKey",                 "ShowDetailView();", true);
4

1 に答える 1

0

これは、コードビハインドからjavascript関数を呼び出す作業コードです。

<script type="text/javascript">
    function ShowAlert() {
      alert('Display Message Alert');
 }   
</script>

コードビハインド

Page.ClientScript.RegisterStartupScript(this.GetType(), "Call my function", "ShowAlert();", true);

ポップアップの代わりにjavascriptでウィンドウを開きたい場合に備えて、

ScriptManager.RegisterStartupScript(Page, typeof(Page), "Alert", "window.open('description.aspx','Mywindow','scrollbars=Yes,width=800,menubar=yes, resizable=No');", true);
于 2013-02-08T06:24:13.073 に答える