error in calling javascript function :( from .aspx page

i hv aspx page like 
<script language ="javascript">
   function newwindow(){
   window.open("mypage.aspx?id=" + document.getElementById('lblid').value);
}
</script>

and in UI code

i have one imagebutton with onclick event
onclick="newwindow();"

i think it should work but dont know why i am getting the following error :
Compiler Error Message: BC30456: 'newwindow' is not a member of 'mypage_aspx'.

please help
0
ask_me
8/7/2005 3:14:29 PM
asp.net.client-side 24353 articles. 2 followers. Follow

2 Replies
648 Views

Similar Articles

[PageSpeed] 3

you need to add it from the code behind

btnId.Attributes.Add("onclick","newwindow();return false;")

Eric
Pascarello.com | Twitter epascarello | LinkedIn
0
A1ien51
8/7/2005 4:56:20 PM
thanks a to n
its working ..but its calling to same aspx page for the 1st time and then i click again it goes to the url ...why is that ?
0
ask_me
8/7/2005 5:15:06 PM
Reply: