Reputation: 939
I am trying to open a window on click of a button that is inside a user control my user control, but the window is not opening when i click on the button the button simply disapears and the page hangs. can anybody help me please.
my code is like this
<asp:TableCell>
<asp:ButtonID="btnSearch"Text="Search"OnClientClick="open();"runat="server"/>
</asp:TableCell>
<script type = "text/javascript>
function open() {
window.open("OnPopUp.aspx");
return true;
}
</script>
Upvotes: 0
Views: 6178
Reputation: 386
Use this code
<asp:TableCell>
<asp:Button ID="btnSearch" Text="Search" OnClientClick="openwd();" runat="server"/>
</asp:TableCell>
<script type = "text/javascript>
function openwd() {
window.open("OnPopUp.aspx");
return false;
}
</script>
Upvotes: 1
Reputation: 3214
user controls in asp.net has the extension .ascx . In your example you r calling OnPopUp.aspx
, rather it should be OnPopUp.ascx
Upvotes: 0