//Call this function from main page..
function openLookup(targetField,windowpage)
{
var w = window.open(windowpage,'BCFSYS','width=572,height=550,scrollbars=1,resizable=no,top=100,left=200');
w.targetField = targetField;
w.focus();
return false;
}
// in lookup page use following javascript function to return back selected value to the main page.
function setValue(val)
{
if (opener && !opener.closed && opener.setTargetField)
{
window.opener.document.getElementById('ctl00_ContentPlaceHolder1_txtDepart').value val;
window.close();
window.opener.setTargetField(window.opener.document.getElementById('ctl00_ContentPlaceHolder1_txtDepart'), val);}
self.close();
}
In rowdatabound event of gridview in lookup page, set setValue function call on click of gridview row..