<asp:Repeater ID="rptrCategory" DataSourceID="dsCollections" runat="server" > <ItemTemplate> <asp:HiddenField ID="hfId" value='<%# Eval("Id") %>' runat="server" /> <li id="l1" runat="server" class='<%#Eval("CategName") %>'><span class="folder"><%# Eval("CategName") %></span> <ul > <asp:Repeater id="rptrTypes" DataSourceID="dsTypes" runat="server" OnItemCommand="rptrCategory_ItemCommand"> <ItemTemplate> <li id="current"> <asp:LinkButton ID="LinkButton1" runat="server" style="color:#000; text-decoration:none;" CommandName="Lnkks" CommandArgument='<%#Eval("CategName") +";"+ Eval("SubCategName")%>' ><%# Eval("SubCategName")%></asp:LinkButton> </span> </li> </ItemTemplate> </asp:Repeater> </ul> </li> <asp:SqlDataSource ID="dsTypes" runat="server" ConnectionString="<%$ ConnectionStrings:csConnectionString %>" SelectCommand="SELECT SubCategory.SubCategName,Category.CategName, SubCategory.Id, SubCategory.CategId FROM Category INNER JOIN SubCategory ON Category.Id = SubCategory.CategId where Category.Id= @categ"> <SelectParameters> <asp:ControlParameter Name="categ" ControlID="hfId" PropertyName="Value" /> </SelectParameters> </asp:SqlDataSource> </ItemTemplate> </asp:Repeater> <asp:SqlDataSource ID="dsCollections" runat="server" ConnectionString="<%$ ConnectionStrings:csConnectionString %>" SelectCommand="SELECT [CategName], [Id] FROM [Category]"></asp:SqlDataSource>
protected void rptrCategory_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Lnkks") { Response.Write("work"); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)