I use showModalDialog function to open popup window, which is ASP.NET page. After I pickup some option in drop down list, I populate window.ReturnValue and press OK button. The modal popup window closes, but I don't know how to pass return value to C# code behind to proceed further.
Here's the code:
Open popup window:
function ClientItemClicked(sender, eventArgs)
{
if (eventArgs.get_item().get_value() == "excel")
{
var retVal = window.showModalDialog("ExportToExcelChoice.aspx", null, "dialogWidth: 400; dialogHeight: 200; center: yes; resizable: no;");
}
}
Close popup window:
function ReturnValue() {
var choice = document.getElementById("DropDownList1").value;
if ((window.opener != null) && (!window.opener.closed)) {
window.ReturnValue = choice;
var result = window.ReturnValue;
}
window.close();
}
I use Firefox.