Results 1 to 7 of 7

Thread: check box no click event?

  1. #1

    Thread Starter
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492

    check box no click event?

    Why doesnt asp.net have a click event for check boxes?

    I NEED a click event...

    the click change event doesnt fire when i click a check box on my asp page...

    Just like a button click i need a check box click..any suggestions...
    I need to be able to click on a check mark and have it execute some code.

    The code I want to run should be in the click event of this check box but I cannot find this check box event ?

    Please advise...

    Thanks,
    Jon

  2. #2
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    I've juts checked this out...hahaha get it? Boom boom.
    Anyways, I thought it was you being American, but you are right...I can't get the CheckedChanged event to fire either
    Booooooo bad MS *slap*

    WOka

  3. #3
    Lively Member
    Join Date
    Sep 2004
    Location
    india
    Posts
    95

    very good quest.

    hay gui,

    add the attribute onclick for checkbox in ur page to fire the event.

    Use chkbox.attrubite.add("eventname","Javascript:function name")


    v.r.mahendran

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Or manually enter it via javascript yourself.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    A click on a checkbox is client-side... not server side. Therefore, it would be silly to include it in the framework. Just like a textbox doesn't have a click event.

  6. #6
    New Member
    Join Date
    Sep 2004
    Posts
    9
    I think checkbox has a method is IsPostBack=True or False. Therefore this method can replace for Click Event.
    Or maybe MS think that no need
    If you want it, you can create a new checkbox control has the Click Event.
    BTW: you want click event run at server or client. If you want it run at client you can use the javascript or else you can do above. Means that you should create your own control.

  7. #7
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I don't know if you solved this or not, but you need to set the AutoPostBack property to true, then double click the control in the designer which will wire up the checkedchanged event. It will then fire when someone checks or unchecks it right away.

    The key is the AutoPostBack property. It signals that action on it causes a post back. Textboxes, checkboxes, listboxes, comboboxes, etc need this set to true if you want immediate action to be taken.

    Pick up a book, it really would be valuable. This is all explained.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width