If i use a standard web form with no master page the following code works fine, when I add it to my master page it will not fire the events. Please advise.


<asp:GridView ID="gvHR" CssClass="gridview" runat="server" AllowPaging="True"   
              EnableViewState="true"   DataKeyNames="HRID" 
              AutoGenerateColumns="False" DataSourceID="ldsHR"               >
                  <asp:BoundField DataField="FirstName" HeaderText="FirstName" ReadOnly="True" 
                      SortExpression="FirstName" />
                  <asp:BoundField DataField="LastName" HeaderText="LastName" ReadOnly="True" 
                      SortExpression="LastName" />
                  <asp:BoundField DataField="EmailName" HeaderText="EmailName" ReadOnly="True" 
                      SortExpression="EmailName" />
                  <asp:TemplateField HeaderText="LeftCompany" SortExpression="LeftCompany">
                          <asp:CheckBox ID="CheckBox1" runat="server"  AutoPostBack="true"   OnCheckedChanged="chkchng"
                              Checked='<%# Bind("LeftCompany") %>' Enabled="true" />

Relevant Code Behind.

Public Sub chkchng(ByVal sender As Object, ByVal e As EventArgs)
        Dim gr As GridViewRow = CType(CType(sender, CheckBox).NamingContainer, GridViewRow)
        gvHR.UpdateRow(gr.RowIndex, True)
    End Sub
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    End Sub


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.