Multilevel Nested Product Categories Display With C# And Sql Server?
Jun 9, 2010
I have a product category table with the following fields:
cat_id (PK)
Cat_name
Cat_desc
Parent_Cat_Id
Now when a user wants to add a product he should be able to select multiple categories from a listbox(multiselection enabaled). But to let the user know the hierarchy of the categories, I need to display them in the following style:
parent category 1
parent category 1->sub category 1
parent category 1->sub category 1->sub-sub category 1
parent category 1->sub category 1->sub-sub category 2
parent category 1->sub category 2
Parent category 2.........
I know that to achieve this I need to use recursive programming. But how can we do it via stored procedures?
View 2 Replies
Similar Messages:
Jan 27, 2011
I'm using Entity Framework.
I have 3 tables:
- Products (Primary key productId)
- Categories (Primary key categoryId)
- Product_to_categories (Table with two fields, CategoryId and ProductId)
One product can be assigned to multiple categories.
How should I download the products from specific category?
Now I retrieve them in that way:
int PageNum = 1;
int PageSize = 10;
int categoryId = 5;
var categoryModel = db.Categories.FirstOrDefault(c => c.CategoryId == categoryId);
var results = (from p in categoryModel.Products select p).Skip((PageNum - 1) * PageSize).Take(PageSize).ToList();
But when there is a lot of products in category my server crushed. I want only 10 products per page.
View 2 Replies
May 7, 2015
i am using asp.net webform not asp.net MVC.
i want to make my webforms as single page application
ex: i have a webform for products and the correspoding Product Links
if i click on any products the related details of that product has to be dispaly in the same webform .
i dont want to goto another webfom and dispaly the details of the product.
View 1 Replies
Apr 7, 2014
I have this interface of multilevel grid built in VStudio 2010 using asp.net.My grid will show the 2nd level then the 3rd (2nd grid as its parent) when plus signs are clicked. however the parent gridview loses its original width when the panel shows up. Is there a way to maintain its width so the design will be as is. See the picture by clicking the link
Attached image ....
View 1 Replies
Dec 5, 2013
In Nested Grid, we get a '+' sign. The problem is that '+' sign appears all times, even if there are no child records for that row. 1. Can we enable/disable OR Hide/Unhide '+' sign. depending on if child rows exits.2. OR alteast we can put some bgcolor indicating to user that this record do have child rows. Without any indicator user may feel quite annoying to click on '+' sign and nothing happens.
View 1 Replies
Jul 10, 2010
I'm trying to design a page that displays all suppliers by their location. I'd quite like this to work from a query that will automatically include new locations added in the future.
At the moment my design has a table that holds 'locations' with locationID and locationName fields. In my 'suppliers' table I also have a locationID to join them.
I'm not sure how to query the database to return all the suppliers in location 1, then all in location 2. (Or even sure of the terms I need to Google to get some examples!) For example:
Location 1
Supplier 1
Supplier 2
Location 2
Supplier 3
Supplier 4
View 3 Replies
Feb 11, 2011
Nested Repeater Issue: Each category list gets populated with the same set of date values rather then being populated with the data associated with that category. Trying to Do: Trying to group FAQ's by category and then list them using the repeaters.
The data is queryed though a business logic layer object that makes a call to the data access layer object. The data access layer object uses linq to sql to return data. There are 3 parameters that are passed into the innerDataSource's ObjectDataSource control to populate the nested repeater control (propID, CatID, isVisible).
With the debugger, the correct data is being returned and written to the nested repeater firing from the nested repeater's ItemDataBound event. Once this event is finished, another event fires and runs the FAQRule object again on the business logic layer which re-populates the nested repeater with the same data for each category. I have 2 repeaters, outerRepater (parent) and innerRepeater(child) with 2 ObjectDataSource controls innerDataSource and outerDataSource. See code below : ASP Page:
<asp:Repeater DataSourceID="outterDataSource" EnableViewState="false" runat="server">
<ItemTemplate>
<%# Eval("Description") + " " + this.Property.PropertyName %>
<asp:Repeater EnableViewState="false" runat="server" DataSourceID="innerDataSource">
<HeaderTemplate>
<ul style="width: 500px">
</HeaderTemplate>
<ItemTemplate>
<div><%# Eval("Question") %></div>
<div><p><%# Eval("Answer") %></p></div>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="innerDataSource"
runat="server"
SelectMethod="FetchFAQSByPrpAndCatID"
TypeName="PropertySite.BusinessRules.FAQRules">
<SelectParameters>......................................
View 3 Replies
Oct 7, 2010
I need to display data in GridView with Multileve hierarchy same like Treeview.
View 5 Replies
Jan 9, 2010
I want to add unlimited categories and sub categories facility, But I couldn't solve it for last two days.
1. DB
CategID,CategName,parentid
Data:
CategID CategName Parent ID
1 Electronics 0 (where 0 means it is main category)
2 TV 1 (Self Join whith the categ id Electronics)
3 Panasonic 2
4 LG 2
5 Toys 0
6 Girls Toys 5
7 Boys Toys 5
8 Criket Related 7
9 Dolls 6
Here I want to display this data in Combo Box like
Electronic
>>TV
>>Panasonic
>>LG
Toys
>>GirlsToys
>>Dolls
>>Boys Toys
>>Criket Realted
View 6 Replies
Dec 8, 2010
i have one requirement like i want to show all the categories with the subcategories ..
i mean if i have the Sale category it will be heading of the gridview and all sub categories of the Sale category foreign key related subcategories display in that gridview like urls .same way it will show all the categories ..
View 7 Replies
Mar 30, 2012
sample code for datalist to display the categories and forum like used in a aspsnippet forum
View 1 Replies
Sep 25, 2010
i want to Create MultiLevel subMenu With this code
[Code]....
I use MenuItems from properties for adding the SubItems. I want to Create this like
[Code]....
but after adding the subItems my Source is like this
[Code]....
the subitems dont Create
I do this job According (post 4) from this link
[URL]
View 1 Replies
Jan 15, 2011
I have to display price for a product in the format of $1,949.00
Present iam displayng like this $1949.00.Using the following code
protected string fool(object x)
{
return "$" + Convert.ToDouble(x).ToString("0.00");
}
View 3 Replies
Aug 25, 2010
How can one rate a product like in Amazon ie display 5 stars, on mouse over star gets selected & on mouse click, rating is saved?
View 8 Replies
Nov 25, 2010
I have a requirement to display my product details inside a tab control.
1. In the first tab, i need to display the image of the product and on the second tab, i need to display some text regarding the product.
2. In the products Search page, I need to display this tab control as the product. I need to display 10 products per page.
View 8 Replies
Mar 21, 2011
i am new to MVC 2 and i am trying to create a shopping cart system , now i am in delima either to use the User Control to display the Product with add to cart button dynamically or to use the controller to get the data and create a new view page.
kindly suggest also what i dont know is how to get the dynamic data in the view page in MVC 2.
View 5 Replies
May 7, 2015
I have gridview in my page that bind from database and show product information and when users click on productimage from gridview it will go to Show.aspx page...
I want know that how many users visit each product...
I mean I want see that How many users click on ProductImage from girdview and go to Show.aspx page(separatly for each product)...
How I can do it?
View 1 Replies
May 7, 2015
how to display recent viewed product in gridview / listview,first one if any user click on any one product on listed all product then and redirect new page where user can view full details of single product ,its going fine but when user back to home then i want to show recent viewed product , recent view product should not save in db ,just save in temporary datatabee and view in gridview , if user see 10 product then it save in temporary datatable and bind into gridview all 10 product.
View 1 Replies
May 11, 2010
Is there any web service which will return the prouct name by accepting the product barcode input?
View 2 Replies
Aug 19, 2010
I have a User Control (ascx) and a property which a want to display in my categories tab in Visual Studio in the category named "Styles".
[Code]....
And here is the problem: Actually I do not need a get, because I only have to set the property (write only property). But when I omit the get, the property is displayed in the "Misc" category in the categories tab in Visual Studio. Only when I code the get as well, then the property is displayed correctly in the "Styles" category in the categories tab in Visual Studio.
Does anybody know why? How can I display the category correctly only with set?
View 2 Replies
Apr 20, 2010
I am building UI for a large product catalog (millions of products).
I am using Sql Server, FreeText search and ASP.NET MVC.
Tables are normalized and indexed. Most queries take less then a second to return.
The issue is this. Let's say user does the search by keyword. On search results page I need to display/query for:
Display 20 matching products on first page(paged, sorted)
Total count of matching products for paging
List of stores only of all matching products
List of brands only of all matching products
List of colors only of all matching products
Each query takes about .5 to 1 seconds. Altogether it is like 5 seconds.
I would like to get the whole page to load under 1 second. There are several approaches:
Optimize queries even more. I already spent a lot of time on this one, so not sure it can be pushed further.Load products first, then load the rest of the information using AJAX. More like a workaround. Will need to revise UI.Re-organize data to be more Report friendly. Already aggregated a lot of fields.
I checked out several similar sites. For ex. [URL]. Not only they display the same information as I would like in under 1 second, but they also include statistics (number of results in each category).
The following is the search for keyword "white" [URL] How do sites like zappos, amazon make their results, filters and stats appear almost instantly?
View 3 Replies
Aug 8, 2010
I have a sql table (ProductsOffers) in which I store all the offers posted for each Product it consists of columns
offerId int
ProductId int
ProductSpec nvarchar 50
OfferDate DateTime
OfferId + ProductId = My primary Key
everyday there will be many offers for each model and some of them may have no offer in this day. Now Suuppose that I have 10 Products with 15 offers. I want a sql sentence or function that let me select the latest offer for each product. When I select by date it returns the last inserted offer and they may have repeated products and also there will be some products not appear in the result. how can I get a result with the latest 10 Offers for all my products with one offer per product
View 8 Replies
Jan 25, 2011
I wanted to make categories for my website. I have plans for 4 categories - we can call them CAT3,CAT2,CAT1 and CAT0.
So for example:
Technology (CAT3) - > Software (CAT2) - > Microsoft (CAT1) -> ASP.NET (CAT0)
These will be clickable links which the user should be able to go through.
What I have done so far is created the CAT3 categories in a Table. Now I want to display them on my website and I have chosen to show it in a ListView control.
How do I make them links so that it will link to the CAT2's then CAT1's then CAT0's. The user should be able to create new Category 0's but not be able to delete them. Also the user should be able to search through the database of all the CAT's using a search box.
What's the best way of doing this? How should I structure this? I've been looking for quite some time now (slept at 2AM :) ) for a solution but I still can't find one.
P.S I am using Visual Studio 2010 Web with ASP.NET and C# and for SQL Server Management Studio.
View 8 Replies
Apr 28, 2010
I using the two tables below to create a list of category titles containing document links so it looks like this:
documentCategoryName
documenttitle
documenttitle
documentCategoryName
documenttitle
documenttitle
Here are my tables:
documents table
documentID int Unchecked
documentName nvarchar(MAX) Checked
documentCat int Checked
documentDescription ntext Checked
documentType nvarchar(MAX) Checked
documentSiteID int Checked
Document category
documentCategoryId int Unchecked
documentCategoryName nvarchar(MAX) Checked
To do this I'm using a nested query which involves alot of code.
all my page code is below:
[Code]....
View 2 Replies
Jul 29, 2010
reading this multilevel xml to a RadGrid. 1) I am planning not to use Aspx for this 2) The node named Item would eventually change as per app Requirements. So, I don't want to restrict my xpath to something like
[code].....
View 1 Replies