How can I call function using button?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Deven Oza
    New Member
    • Oct 2006
    • 53

    How can I call function using button?

    The following lines of code calling TerminateManage r.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.PlaceHolde rTerminateManag erButton.Contro ls.Add(new LiteralControl( "<input type='Button' value='Terminat e Manager' onclick='javasc ript:location.h ref=\"Terminate Manager.aspx?or gID="+ orgID + "\";'"));
  • searock
    New Member
    • Mar 2010
    • 9

    #2
    You need to use onclick=check() instead of onclick='javasc ript: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()"

    Comment

    Working...