Open Alert Box, Input Box, and Confirm box in Silverlight 2.0 Get the RSS for this comments
In Silverlight we can directly work with the HTML DOM (Document Object Model). For this we can use System.Windows.Browser.HtmlPage object.

0 Comment(s) | 2067 View(s) | 29 Vote(s) | Average rating: 5.0 Rated | Tips Category | dhiraj Submitted on 10/10/2008

In Silverlight we can directly work with the HTML DOM (Document Object Model). For this we can use System.Windows.Browser.HtmlPage object.

Make certain to first add a reference to the following namespace:
using System.Windows.Browser;

To illustrate this point I will walk you through demos that will help to understand and how to use.

Alert Box - Displays a dialog box that contains an application-defined message.

System.Windows.Browser.HtmlPage.Window.Alert("Hello World");

Input Box (Prompt) - Displays a dialog box that prompts the user with a message and an input field.

string strInputByuser = System.Windows.Browser.HtmlPage.Window.Prompt("What is your name");

Confirm Box - Displays a confirmation dialog box that contains an optional message as well as OK and Cancel buttons.

bool blnResult = System.Windows.Browser.HtmlPage.Window.Confirm("Do you want to delete")


Thank you,
--Dhiraj Gupta


How would you rate this article?

User Comment(s)

Name:
E-mail:
Url:
Comment:
Insert Cancel