ASP.NET & message box

  • Thread starter Thread starter DzemoT.
  • Start date Start date
D

DzemoT.

how go i get message box in asp.net app like Hotmail when deleting trash
folder?
 
If you only need an alert box,

/// <summary>
/// Adds a JavaScript "alert()" with strMessage to Page Startup
/// </summary>
/// <param name="strMessage">Message to display</param>
public static void MsgBox(string strMessage)
{
StringBuilder s;
System.Web.UI.Page p;
if (HttpContext.Current == null) return;
s = new StringBuilder("<script type=\"text/javascript\">" +
Environment.NewLine +
"<!--" + Environment.NewLine);
s.Append("alert('" + strMessage.Replace("\"", "\\\"") + "');" +
Environment.NewLine + "// --></script>");
p = (System.Web.UI.Page) HttpContext.Current.Handler;
if (!(p.IsStartupScriptRegistered("MsgBox")))
p.RegisterStartupScript("MsgBox", s.ToString());
}

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

bassil said:
You can try this one:

MessageBox for ASP.NET from http://www.bassilsoft.com

MessageBox is a handy component to create a message box on a Web page in
seconds.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top