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

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.