have ASP.NET web application that contains master page. Master page
contains content page. Content page contains user control. User control
contains Telerik grid with its context menu.
Because hidden field is placed in user control and the code can't get the reference to hidden field.
I'd like to click the item in grid's context menu and open new popup modal window. In that window there's drop down list. I pick up some option from drop down list and click OK. I'd like to get the value selected from drop down list and use it in my ASP.NET code to proceed further.
I've tried to use hidden field to store the value from drop down list but it doesn't work because I'm not sure where hidden field should be placed.
This is my 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;"
);
}
}
Click "OK" to close popup window:
function
ReturnValue() {
var
choice = document.getElementById(
"DropDownList1"
).value;
if
((window.opener !=
null
) && (!window.opener.closed)) {
window.opener.document.getElementById(
"HiddenField1"
).value = choice;
}
window.close();
}
It fails on this line:
window.opener.document.getElementById(
"HiddenField1"
).value = choice;
Because hidden field is placed in user control and the code can't get the reference to hidden field.
Could someone help me to make it work as soon as possible?
Thank you in advance.