Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checkbox onclick 1

Status
Not open for further replies.

briancostea

Programmer
Apr 21, 2005
82
US
does anyone know how i can call a subroutine when a user checks or unchecks a checkbox? i tried:

<asp:checkbox id="x" runat="server" onclick="sub" />

but i get an error ... could not find attribute "onclick"

thanks - brian
 
Just set the AutoPostBack to True and add an event handler for OnCheckedChanged e.g.
Code:
    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

    End Sub


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
thanks much ... all i needed to add was the AutoPostBack and it worked like a dream. i will be sure to star you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top