且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何调用window.alert(QUOT;消息");从C#?

更新时间:2023-02-15 21:06:07

你的意思是,一个消息框?

  MessageBox.Show(错误信息,错误标题,MessageBoxButtons.OK,MessageBoxIcon.Exclamation);

点击此处了解详情:http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox(v=VS.100).aspx

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 to call window.alert function here
}

Do you mean, a message box?

MessageBox.Show("Error Message", "Error Title", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

More information here: http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox(v=VS.100).aspx