Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
On chkSubModuleView_CheckedChanged() event iwant to get the id of chkModule.Please tell me how to get the id or reference of parent checkbox on click of child checkbox in server side.How to distinguish between different modules


<asp:ListView ID="lvModule" runat="server">
                <layouttemplate>
                    <table width="600px" border="0" cellpadding="0" cellspacing="0">
class="ListViewtable">
                        <tr>
                            <th style="width: 10%;">
                                Modules
                            </th>
                        </tr>
                        <asp:PlaceHolder ID="itemPlaceholder" runat="server"> 

                    </table>
                </layouttemplate>
                <itemtemplate>
                    <tr>
                        <td>
                            <asp:CheckBox ID="chkModule" runat="server"   
CausesValidation="false" AutoPostBack="true"
                                OnCheckedChanged="chkModule_CheckedChanged" > 
<asp:HiddenField ID="hfEntityName"
                                    Value='<%# Eval("EntityName") %>' runat="server" />
                            <%# Eval("Title")%>
                            <asp:HiddenField ID="hfID" Value='<%# Eval("ID") %>'   
runat="server" />
                            <asp:Label ID="label" runat="server">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="padding-removed 20px;">
                            <asp:ListView ID="lvSubModule" runat="server">
                                <layouttemplate>
                                    <table width="100%" cellspacing="0" border="0">
class="ListViewtableLayer2">
                                        <tr>
                                            <th style="width: 20%;">
                                                Sub Module
                                            </th>
                                            <th style="width: 20%;">
                                                <asp:CheckBox ID="chkSubModuleView"  
Checked="true" runat="server" AutoPostBack="true"

OnCheckedChanged="chkSubModuleView_CheckedChanged" />
                                                View
                                            </th>

                                        </tr>
                                        <asp:PlaceHolder ID="itemPlaceholder"   
runat="server">
                                    </table>
                                </layouttemplate>
                                <itemtemplate>
                                    <tr>
                                        <td>
                                            <%# Eval("Title")%>
                                            <asp:HiddenField ID="hfMenuID" Value='<%#  
Eval("MenuID") %>' runat="server" />
                                            <asp:HiddenField ID="hfName" Value='<%#   
Eval("HeaderID") %>' runat="server" />
                                        </td>
                                        <td>
                                            <asp:CheckBox ID="chkRead" runat="server"  
AutoPostBack="true" Checked="true" CausesValidation="false"

OnCheckedChanged="chkRead_CheckedChanged">
                                        </td>

                                    </tr>
                                </itemtemplate>
                            
                        </td>
                    </tr>
                </itemtemplate>
Posted
Updated 21-Jun-13 23:48pm
v2
Comments
PrissySC 24-Jun-13 11:21am    
Did you create the oncheckedchanged yet? I don't see it. What language?

A link on referencing the containers ... http://stackoverflow.com/questions/698434/accessing-parent-control-from-child-control-asp-net-c-sharp

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900