Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Events from a custom control

Events from a custom control

Scheduled Pinned Locked Moved ASP.NET
javascripthelptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Senseicads
    wrote on last edited by
    #1

    I have a user control built with a checkbox list as part of it. It was built by someoneelse and i am just attempting to use it. I want to be able to handle the checkboxlist selectedindexchanged event when using the control as part of another webpage. Can someone help me as to how I should do this please? Its got me a little confused. I have set up a property to return the checkboxlist as an object but don't know how to set it up to get the event. i have snipped and edited down the whole control and it is detailed below. Sorry if its a lot of code but better that you have all the info. <%@ Control Language="VB" ClassName="ctlDropDownCheckBox" %> Protected Width As Long = 150 Public ReadOnly Property List() As CheckBoxList Get List = chkResults End Get End Property

    ">

    " class="uiSelectBox" style="display:none;" onclick="javascript:<%= Me.ClientID %>_Update();" ondatabinding="javascript:alert('100');" >

    Cheers Ian

    C 1 Reply Last reply
    0
    • S Senseicads

      I have a user control built with a checkbox list as part of it. It was built by someoneelse and i am just attempting to use it. I want to be able to handle the checkboxlist selectedindexchanged event when using the control as part of another webpage. Can someone help me as to how I should do this please? Its got me a little confused. I have set up a property to return the checkboxlist as an object but don't know how to set it up to get the event. i have snipped and edited down the whole control and it is detailed below. Sorry if its a lot of code but better that you have all the info. <%@ Control Language="VB" ClassName="ctlDropDownCheckBox" %> Protected Width As Long = 150 Public ReadOnly Property List() As CheckBoxList Get List = chkResults End Get End Property

      ">

      " class="uiSelectBox" style="display:none;" onclick="javascript:<%= Me.ClientID %>_Update();" ondatabinding="javascript:alert('100');" >

      Cheers Ian

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You don't want to return the checkbox as a property. Use a delegate to define an event when the check changes, that you can then subscribe to in the containing page, and that gets called when the check changed gets called inside the control.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      S 1 Reply Last reply
      0
      • C Christian Graus

        You don't want to return the checkbox as a property. Use a delegate to define an event when the check changes, that you can then subscribe to in the containing page, and that gets called when the check changed gets called inside the control.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        S Offline
        S Offline
        Senseicads
        wrote on last edited by
        #3

        Thanks a ton Christian, You know when a solution is staring you right in the face and you can't see it!! :D Most of that I think was down to me using another person's control and attempting to make it work with what they had done...note to self...think outside the box :D Cheers Ian

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups