Protected Sub Button1_Click(ByVal sender As Object, _ ByVal e As EventArgs) Handles Button1.Click ' Display the Dialog Window. Me.WebDialogWindow1.WindowState = _ Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal End Sub
By default, the WebDialogWindow™ control’s WindowState property is set to Normal, which means it will display on your web page when the page first loads. However, if you are using the dialog window as a popup dialog box, you will need to first hide the dialog window, and then display it through a button’s Click event or some other means. Displaying the dialog window is as easy as hiding it, simply set the WindowState property to Normal. A common scenario is when an end user clicks a button to postback some data to the server. If there is a problem with that data, you can display the dialog window as an error message along with a text box to allow the end user to correct the problem. In that button’s Click event, all you need to do to display the dialog window is set WindowState to Normal.
The following code demonstrates how to display a dialog window inside a button’s Click event.
In Visual Basic:
Protected Sub Button1_Click(ByVal sender As Object, _ ByVal e As EventArgs) Handles Button1.Click ' Display the Dialog Window. Me.WebDialogWindow1.WindowState = _ Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal End Sub
In C#:
protected void Button1_Click(object sender, EventArgs e) { // Display the Dialog Window. this.WebDialogWindow1.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal; }