Results 1 to 1 of 1

Thread: ASP.NET Web Control custom checkbox events

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2014
    Melbourne, Australia

    ASP.NET Web Control custom checkbox events

    I have a Custom User control that is being used through this project and it seems to render based on the Type field. So the code below ends up returning a System.Web.UI.WebControls.CheckBox but my OnCheckedChanged event is not firing with or without AutoPostBack set.

    HTML Code:
    <wn:CustomControl ID="CustomCtrl1" runat="server" Type="CheckBox" 
       OnCheckedChanged="CustomCtrl1_OnChecked" AutoPostBack="true" />
    Protected Sub CustomCtrl1_OnChecked(sender As Object, e As EventArgs)
       label1.Visible = False
    End Sub
    I am a bit new to Custom controls but kind of understand how it is used in this project I am maintaining. When I go to the definition of DirectCast (which is what I assume is rendering or mapping the control) it goes to the CheckBox class which has a CheckedChanged event and a OnCheckedChanged subroutine. I attempted to change it to CheckedChanged and still nothing.

    Any ideas?

    Project specs that might be related:
    • ASP.NET 4.6.2
    • VS 2019
    • Web Forms
    Last edited by sharpCode#; Nov 13th, 2019 at 01:15 AM. Reason: adding some project specs

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