Hi, Everybody I am New in ASP.Net
I am developing an website i want to show messagebox like windows application i am useing asp.net with c#. How i can do this.


Can anybody help me please..........
Thanks in Advance

Recommended Answers

All 8 Replies

Member Avatar for stbuchok

JavaScript.

alert('Message goes here.');

you can't show messegebox in asp.net. you can do that in javascript using Alertbox.

messagebox.show("hi");

you can use response.write() instead

sorry message box is for window forms and in asp.net response.write is used

if you are developing the web application you can use MessageBox.Show("Your Message");
and if you are using the window app then use the javascript to display msgbox
<script language="javascript">
alert('Your Message')
</script>

Member Avatar for stbuchok

pritishdeshmuk, pretty sure you have that reversed.

alert() is web app and MessageBox is windows app. Not to mention, it's already been said twice that alert should be used as this is an ASP.Net page (Active Server Pages, as in Web Page). Please stop responding with the same answer as everyone else. Not to mention, this has been answered since the first post.

pritishdeshmuk: pretty sure you have that reversed.

alert() is web app and MessageBox is windows app. Not to mention, it's already been said twice that alert should be used as this is an ASP.Net page (Active Server Pages, as in Web Page). Please stop responding with the same answer as everyone else. Not to mention, this has been answered since the first post.

Dear,
Plz check this one,in which you can cl the message box with this method or at page load plz use your own logic to implement this.

public void YourMethodName() 
{
    // Display a message box informing the user 
   MessageBox.Show ("The calculations are complete", "My Application", 
MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);
}

============OR=============

private void Form1_Load(object sender, EventArgs e)
    {
        //
        // The simplest overload of MessageBox.Show. [1]
        //
        MessageBox.Show("Your Message.");
        //
         }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.