OK, this works but I have a further question...
Step 1: Add Attribute to the dropdownlist control
dlAllStockists.Attributes.Add("onChange","javascript:openWindowFromDropDownList('editStockist.aspx?SID=','edit','scrollbars=yes,resizable=yes,width=850,height=500')")
Step 2: Write the javascript function and place within HTML Head tags as normal
<script type="text/JavaScript">
<!--
function openWindowFromDropDownList(theURL,winName,features)
{
var SID = document.forms[0].dlAllStockists.value
if (SID > 0){
theURL = theURL + document.forms[0].dlAllStockists.value
window.open(theURL,winName,features);
}
}
//-->
</script>
Here I reference the ASP.Net control using its ID to get its value once rendered. I then check if anything has been selected and if so, open the new window.
It works. So thats good.
But...in my newly opened browser window I have a function to refresh the page that opened it. Opening the window with the above method doesn't seem to let me use the page refresh function in the opened window. However, if I open the new window with a simple hyperlink OnClick, I am able to use the refresh parent page function in the newly opened browser window.
The refresh page function is: onClick="window.opener.location.reload();
It does nothing. As if the window doesn't think it has an 'Opener'.
Any ideas as to why this might happen?