This article explains that how you can show Messages Boxes in ASP.NET
These are some ways : 1. Using server side message box 2. Add Attributes
Understanding exactly the case and situation, you can choose any of the above method stated
The Server Side Message Box needs to import Microsoft.Windows.Forms in your Reference List of the project,
and easiest to use. If you want to use this
-->> Add reference for Microsoft.Windows.Forms
-- >> imports Microsoft.Windows.Forms
Dim msbox as messageBox msbox.show("hello") ' will shows the simple alert box
Dim msbox As MessageBox Dim result As String result = msbox.Show("test", "test", MessageBoxButtons.OKCancel, MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly) If result = "OK" Then Response.Write("You pressed OK") Else Response.Write("You pressed CANCEL") End If
Add Attribute : When you doesnot want to overloads your project with the assembely then you can use this method. In the Page Load section of the form State this for calling a confirmation box on BtnDelete click
Page_Load BtnDelete.Attributes.Add("OnClick","return(confirm('Do you want to delete this?'));")
where BtnDelete is server side button. This will call only if you press Ok in the confirmation Box.
Regards, Abhay Lakkad
|
No responses found. Be the first to respond and make money from revenue sharing program.
|