I’m developing a asp.net web application and I have this script in source code:
<script language="javascript" type="text/javascript">
function showWindow(URL, controlID, targetControlID,id)
{
noweOkno = window.open( URL + '?controlID='+controlID+'&targetControlID=' +
targetControlID+'&id='+ id, '_blank',
'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=no, ' +
'status=no, width=760, height=600, left=30, top=30')
noweOkno.focus();
}
</script>
I can call it with this code:
Button4.Attributes["onClick"] = string.Format("showWindow( 'Child.aspx','{0}', '{1}','{2}');", tbVer.ClientID, Hidden1.ClientID, id_act);
my question is, how to call the javascript in some C# method like:
protected void someMethod()
{
-I want to call showWindow('Child.aspx','{0}', '{1}','{2}');", tbVer.ClientID, Hidden1.ClientID, id_act);
}
thanks
You can register script block to run on page like :