Posted by Joe | Posted in Silverlight | Posted on 03-06-2009
To use alert, confirm and input message boxes in Silverlight you need to import the following namespace.
using System.Windows.Browser;
You can then show an alert box by doing…
HtmlPage.Window.Alert("This is an alert")
Or a confirm dialog by doing…
if (HtmlPage.Window.Confirm("Are you sure you want to do something?"))
{
//Do something
}
Or an input prompt by doing…
string name = HtmlPage.Window.Prompt("What is your name?");


