The following is the only method I have found to call a DialogBox with ASP.NET
I have a server side button that has client side code that runs when it is clicked.
<MainForm.aspx>
The value returned from the dialogbox is written to "lblInfo" which is a server side label.Code:<script... Sub cmdCust_OnClick Dim sCustomers, sOptions sOptions = "dialogHeight: 325px; dialogWidth: 400px; Center: Yes; Scroll: No; Status: No; Help: No;" sCustomers = window.showModalDialog("customersframe.htm",,sOptions) Document.getElementById("lblInfo").innertext = sCustomers End Sub ..\script>
The Page_Load event contains the following code
The lblInfo.Text is empty. Even though it is a server side control, and the text even appears on the form briefly while stepping through the code.Code:Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If (IsPostBack) Then Dim sCust As String sCust = lblInfo.Text end if End Sub
I don't understand why this control contains no data?
I have tried to use a txtbox control as well, with the same result. I also tried to read the value of the lable in the .VB cmdCust.Click(...) event. (By stepping through the code, I realized client side code is run first)
In every case this field is empty and I cannot get the string from the Dialog box to the form. What am I doing wrong??




Reply With Quote