Using Javascript in Nested Datalist
Hi,
I have two datalists. One simply have a linkbutton with text containing category name & other datalist is inside the first one containing products from respective category.
Html looks something like this.
<asp:datalist id="dlCat" runat="server" Width="100%">
<ItemTemplate>
<table Width="100%">
<tr>
<td Width="100%">
<asp:TextBox ID="txtid" Runat=server Visible=False Text='<%# DataBinder.Eval(Container.DataItem,"catid")%>'>
</asp:TextBox>
<asp:Button id="btnShow" runat="server" CommandName="show" Text='<%# DataBinder.Eval(Container.DataItem,"catname")%>'>
</asp:Button>
</td>
</tr>
<tr>
<td width="100%">
<asp:DataList Runat="server" ID="dlProd" Width="100%">
<ItemTemplate>
<table Width="100%">
<tr>
<td Width="100%">
<%# DataBinder.Eval(Container.DataItem,"prodname")%>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
</table> </ItemTemplate>
</asp:datalist>
I have already bound both the lists.
Now the problem is that I want the second list to be invisible by default.When user clicks on linkbutton, the appropriate child datalist should be visible.All the others should be kept invisible.
This should be done Client side.
I tried a lot for this.Now I think it is almost near to impossible.
Can anyone have idea about this? or any other solution for doing the same?
Thanks...
Savan
__________________
Savan
|