By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,229 Members | 630 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,229 IT Pros & Developers. It's quick & easy.

How can I call function using button?

P: 53
The following lines of code calling TerminateManager.aspx page when I click on button(please see the code), instead of calling .aspx page I want to call function Check(), how can I do that?
This following code is written in aspx.cs page and the function Check() I like to call is also in the same page.

Please help! Thanks!

this.PlaceHolderTerminateManagerButton.Controls.Ad d(new LiteralControl("<input type='Button' value='Terminate Manager' onclick='javascript:location.href=\"TerminateManag er.aspx?orgID="+ orgID + "\";'"));
Mar 8 '10 #1
Share this Question
Share on Google+
1 Reply

P: 9
You need to use onclick=check() instead of onclick='javascript:location.....

and can you tell me that is check() a server side method or a client side java script method()

if check is a javascript method then you need to add one more attribute OnClientClick="Check()"
Mar 9 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.