G
Guest
I have a popup window, which consist of a asp:textbox and a asp:button. And,
I would like to pass the textbox.text to the javascript function when I click
the button. Besides, by clicking the button, also close the popup window. The
problem is, when I click the button, the textbox.text is successfully pass to
the javascript function and the popup window will be closed, but the popup
window will be opened again in maximize mode. I notice that, after I add the
line 'Me.btnOK.Attributes.Add...' in my Page_Load event, this thing only
happen. Why is it so?
Please help...thanks.
FYI, the following is my page_load code in code-behind:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.btnOK.Attributes.Add("onclick", "Done('" &
txtConnectionString.Text & "');")
End Sub
The following is my html code:
<script language="javascript">
function Done(strConnectionString) { alert(strConnectionString);
window.close();
}
</script>
Following is the javascript function's code in parent page to call the
popup-dialog window:
<script language="javascript">
function OpenConnectCubeDialog() {
var ParmA;
var ParmB;
var MyArgs = new Array("", "");
var WinSettings =
"center:yes;resizable:no;dialogHeight:270px;dialogWidth:311px;";
var MyArgs = window.showModalDialog("/ModalDialog/ConnectToCube.aspx",
MyArgs, WinSettings);
if (MyArgs != null) {
ParmA = MyArgs[0].toString();
ParmB = MyArgs[1].toString();
initializePivotTable(ParmA, ParmB);
}
}
</script>
Thanks.
I would like to pass the textbox.text to the javascript function when I click
the button. Besides, by clicking the button, also close the popup window. The
problem is, when I click the button, the textbox.text is successfully pass to
the javascript function and the popup window will be closed, but the popup
window will be opened again in maximize mode. I notice that, after I add the
line 'Me.btnOK.Attributes.Add...' in my Page_Load event, this thing only
happen. Why is it so?
Please help...thanks.
FYI, the following is my page_load code in code-behind:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.btnOK.Attributes.Add("onclick", "Done('" &
txtConnectionString.Text & "');")
End Sub
The following is my html code:
<script language="javascript">
function Done(strConnectionString) { alert(strConnectionString);
window.close();
}
</script>
Following is the javascript function's code in parent page to call the
popup-dialog window:
<script language="javascript">
function OpenConnectCubeDialog() {
var ParmA;
var ParmB;
var MyArgs = new Array("", "");
var WinSettings =
"center:yes;resizable:no;dialogHeight:270px;dialogWidth:311px;";
var MyArgs = window.showModalDialog("/ModalDialog/ConnectToCube.aspx",
MyArgs, WinSettings);
if (MyArgs != null) {
ParmA = MyArgs[0].toString();
ParmB = MyArgs[1].toString();
initializePivotTable(ParmA, ParmB);
}
}
</script>
Thanks.