How to call window.alert(“message”); from C#?

后端 未结 10 2310
春和景丽
春和景丽 2021-02-07 05:18

I have my own exception based on some condition and want to raise an alert when control comes in this catch block

catch (ApplicationException ex)
{
    //want t         


        
10条回答
  •  野性不改
    2021-02-07 05:49

    if you are using ajax in your page that require script manager Page.ClientScript
    will not work, Try this and it would do the work:

    ScriptManager.RegisterClientScriptBlock(this, GetType(),
                "alertMessage", @"alert('your Message ')", true);
    

提交回复
热议问题