asp check box - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

asp check box

smear22smear22 Posts: 3Member
want to add text to an asp page when the check box is ticked how do i go about this? its static text by the way some code snippets would be very helpful

thanks

Comments

  • iwilld0itiwilld0it Posts: 1,134Member
    : want to add text to an asp page when the check box is ticked how do i go about this? its static text by the way some code snippets would be very helpful
    :
    : thanks
    :
    :

    1. Modify checkbox to post back to server
    2. Load text in a label

    Step 1. is easy, just set the autopostback property to true like so:

    [code]

    [/code]

    Step 2. make sure you have a label control placed where you want the text to show up like so ...

    [code]

    [/code]

    Then on the code side ...

    [code]
    Private Sub chk_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chk.CheckedChanged
    lbl.Text = "Some Text"
    End Sub
    [/code]

    The CheckedChanged event will fire as soon as you post back to the webserver. Which happens when you click the checkbox, because AutoPostback is set to true.



Sign In or Register to comment.