I have added a button to my form which is calling some javascript to open it up as a POPup... I keep getting this error:
'btnFindPO_Click' is not a member of 'ASP.softwarelist_aspx'.
What could be causing this when on a similar for this approach works well? Could I just do it in VB.net instead of Java and still control the POPup in the same way?
check you have that event handler in Codebehind.....also check if codebehind and aspx page properly binded with codefile attribute in page directive....
The onclick="btnFindPO_Click" is looking for an event handler in your code behind. The error is just complaining it can't find that event handler. If the only thing that button is doing is executing javascript, just remove the onclick="btnFindPO_Click"
from the button declaration.
Eugene1968
Member
90 Points
360 Posts
Button "is not a member of 'ASP."
Nov 06, 2012 01:32 PM|LINK
I have added a button to my form which is calling some javascript to open it up as a POPup... I keep getting this error:
'btnFindPO_Click' is not a member of 'ASP.softwarelist_aspx'.
What could be causing this when on a similar for this approach works well? Could I just do it in VB.net instead of Java and still control the POPup in the same way?
<script type="text/javascript">
function OpenPopup() {
window.open("ViewPOs.aspx", "List", "scrollbars=yes,resizable=no,width=700,height=600");
return false;
}
</script>
<asp:Button ID="btnFindPO" runat="server" Height="23px"
Text="Find PO" BackColor="#990000" Font-Bold="True"
ForeColor="White" OnClientClick="OpenPopup()" Width="67px"
onclick="btnFindPO_Click"/>
ramiramilu
All-Star
97799 Points
14494 Posts
Re: Button "is not a member of 'ASP."
Nov 06, 2012 01:44 PM|LINK
check you have that event handler in Codebehind.....also check if codebehind and aspx page properly binded with codefile attribute in page directive....
Thanks,
JumpStart
texx
Contributor
2412 Points
415 Posts
Re: Button "is not a member of 'ASP."
Nov 06, 2012 01:44 PM|LINK
The onclick="btnFindPO_Click" is looking for an event handler in your code behind. The error is just complaining it can't find that event handler. If the only thing that button is doing is executing javascript, just remove the onclick="btnFindPO_Click" from the button declaration.
Eugene1968
Member
90 Points
360 Posts
Re: Button "is not a member of 'ASP."
Nov 06, 2012 03:45 PM|LINK
Thanks for the help... one other problem is closing the form with a Cancel button... any idea why this would not work?
<script type="text/javascript">
function ClosePopup() {
window.close;
return false;
}
</script>
<asp:Button ID="btnCancel" runat="server" OnClientClick="ClosePopup()" Text="Cancel"
Height="23px" Font-Bold="True" ForeColor="White"
BackColor="#990000" Width="175px"/>
Amy Peng - M...
Star
11649 Points
1082 Posts
Microsoft
Re: Button "is not a member of 'ASP."
Nov 07, 2012 04:43 AM|LINK
Hi Eugene1968,
There are two ways to call javascript function in asp.net:
one is just change 'OnClientClick="ClosePopup()"' to OnClientClick="javascript:ClosePopup()"
the other way is using .cs:
protected void btnCancel_Click(object sender, EventArgs e) { btnCancel.Attributes.Add("OnClick", "ClosePopup()"); }Hope it can help you!
Regards,
Amy peng
Feedback to us
Develop and promote your apps in Windows Store
Ruchira
All-Star
44216 Points
7184 Posts
MVP
Re: Button "is not a member of 'ASP."
Nov 07, 2012 01:55 PM|LINK
Hello,
What form?
You can't use window.close to close the webpages which was not opened using window.open method.
Also, please mark the posts which helped you as the answers and start new threads for your new problems.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.