Click here to Skip to main content
15,885,944 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
how to display messages in asp.net using C# language like MessageBox.show(""); in windows applications?
Posted

There is the JavaScript function alert, but this is pretty ugly. Please see:
http://www.w3schools.com/js/js_popup.asp[^].

The best modal functionality without ugly pop-ups close to the message box is probably the jQuery modal box. Please see:
http://archive.plugins.jquery.com/project/modalBox[^].

There is a number of different alternative implementation of similar modal boxes, such as:
http://web.enavu.com/tutorials/top-10-jquery-modal-box-plugins/[^],
http://www.jquery4u.com/windows/14-jquery-modal-dialog-boxes/[^],
http://coderplus.com/2009/11/jquery-modal-boxes-to-improve-your-ui/[^],
http://www.webgurusdesignblog.com/2009/02/10-best-modal-boxes-for-web-design-projects/[^].


If you are not well familiar with jQuery yet, I would advise to learn some jQuery if you want advanced JavaScript UI with good feature and maintainability. You can start here:
http://docs.jquery.com/Tutorials:How_jQuery_Works[^],
http://docs.jquery.com/Tutorials[^],
http://docs.jquery.com/Main_Page[^].

—SA
 
Share this answer
 
Comments
Prasad_Kulkarni 12-Jul-12 0:40am    
Many alternatives.
Good collection, +5!
Sergey Alexandrovich Kryukov 12-Jul-12 0:49am    
Thank you, Prasad.
--SA
vangapally Naveen Kumar 12-Jul-12 0:59am    
Good Links..........
Hi,
There is nothing like Message.Show() in asp.net. If you want to show the messages then you can use javascript as follows:
C#
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyScript", "alert('Saved Successfully !!');", true);

For more details you can view this[^].

All the best.
--Amit
 
Share this answer
 
v2
C#
protected void Btn_Click(object sender, EventArgs e)
    {
        ScriptManager.RegisterStartupScript(
            this,
            this.GetType(),
            "MessageBox",
            "alert('this is message Box');",
            true);
    }
 
Share this answer
 
I think this is exactly what you need: A Windows Form like MessageBox for ASP.NET Website[^]

Let me know if it helped.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900