•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 391,774 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,359 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 400 | Replies: 0
![]() |
| |
Hi,
I have a page containing categories and subcategories.
Iam using datalist to display categories.
I want ot get subcategories based on categories selected.
On clicking on again subcategories i need to display subsubcategories.
ex:
Agriculture
|
V
plantproducts
|
V
beans
|
V
green beans
|
V
product page.
a category can have any no of subcategories in it.
I want to display all this in a single page.
Cn anyone suggest what control to use for it and the procedure.My code is like this
waiting for your reply
I have a page containing categories and subcategories.
Iam using datalist to display categories.
I want ot get subcategories based on categories selected.
On clicking on again subcategories i need to display subsubcategories.
ex:
Agriculture
|
V
plantproducts
|
V
beans
|
V
green beans
|
V
product page.
a category can have any no of subcategories in it.
I want to display all this in a single page.
Cn anyone suggest what control to use for it and the procedure.My code is like this
ASP Syntax (Toggle Plain Text)
<asp:DataList ID="ddlist" CellPadding="5" CellSpacing="5" RepeatDirection="Vertical" RepeatLayout="Table" runat="server" OnItemCommand="ddlist_ItemCommand" > <HeaderStyle BackColor="#aaaadd"> </HeaderStyle> <AlternatingItemStyle BackColor="Gainsboro"> </AlternatingItemStyle> <HeaderTemplate> <asp:Label ID="lblh" runat="server" Text="Business Catalogs" ></asp:Label> </HeaderTemplate> <ItemTemplate> <asp:LinkButton ID="lnkbtn" runat="server" CommandArgument='<%# Eval("CAT_ID") %>' ></asp:LinkButton> </ItemTemplate> </asp:DataList> protected void ddlist_ItemCommand(object source, DataListCommandEventArgs e) { ContentPlaceHolder mcon = new ContentPlaceHolder(); mcon = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1"); LinkButton lnk = new LinkButton(); lnk = (LinkButton)e.Item.FindControl("lnkbtn"); int id = (int.Parse(lnk.CommandArgument)); ICollection Catlist = ProductManager.Get_Categories(int.Parse(Session["check"].ToString()), id); if (Catlist.Count > 0) { //Label lbl = new Label(); //lbl = (Label)ddlist.FindControl("lblh"); //lbl.Text += ">" + lnk.Text; j = j + 1; Session["check"] = j.ToString(); Response.Write(Session["check"].ToString()); ddlist.DataSource = ((DataRowCollection)Catlist)[0].Table; ddlist.DataBind(); for (int i = 0; i <= ddlist.Items.Count - 1; i++) { LinkButton hyp = new LinkButton(); hyp = (LinkButton)ddlist.Items[i].FindControl("lnkbtn"); hyp.Text = ((DataRowCollection)Catlist)[0].Table.Rows[i].ItemArray[1].ToString(); } } else { Response.Write(Session["check"].ToString()); Session["check"] = 2; Response.Redirect("ViewProductInformation.aspx"); } }
Last edited by peter_budo : May 24th, 2008 at 7:13 pm. Reason: Keep It Organized - please use [code] tags
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
Other Threads in the ASP.NET Forum
- Previous Thread: Regular Expressions
- Next Thread: Formating Problem Please Help!!!


Hybrid Mode