The administrator is able to add categories in which the users can upload the documents. On the page where the documents are shown, they need to be shown under which category they are uploaded. All the info is stored in the database, I want to know how I can display that nicely. Categories and under each categories, files for that category.
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
I need to bind a dropdownlist to multiple column along with the column heading.. the heading should be unselectablesomething similar to thisEach group are in differnet tables..ow can i implement thisits consuming my time..
I would like to set the page heading according to the querystring value. So, it is something like this: From Page1.aspx I am redirecting to Page2.aspx.
In Page1, I have list of image buttons depicting different Departments coming from database. On clicking the particular Image button I will be redirected to Page2.aspx which shows info regarding to that department.
Now, I want to reset the page heading of Page2.aspx,depending on the Department,so, it should be: MyProject-Accounts,MyProject-Marketing etc. It is having master pages as well.
I am using asp.net validation controls in my application. the alert messages are showing in validation summary. now i should change the title(heading) of the alert(message) box.how to do this ?
I am using a Webgrid as part of an MVC 3 app. The weird thing is the first display of the page with the grid displays fine but when I click on a heading to sort, the grid is not displayed as part of the page when I am running under the web server provided by the VS 2010 installation. When I do a View Source of that page, all of the grid stuff (as table elements) is there to be displayed. It just does not show up in the browser. So, I wrote the html to a file and copied the javascript and css files to the same folder and then ran the file under IE and everything displays as it should.
I have a gridview on a form and a button to export to excel. Export works fine but I need to add a heading etc. in like this:MY REPORTDate : 10/09/2010GridviewHere is the code that exports to excel
I have a number of products in a SQL2005 DB. I have the Stored Procedure set-up to return the info as grouped rows containing 'manufacturer, model, quantitiy'.
I need to then display this content on a c# Asp.Net 4 web form grouped by manufacturer with the manufacturer as the group header. The whole data should be displayed over a 3 column layout.
So, Ive used a Datalist as this allows for the number of columns to be stipulated.
However, I can't work out an effective way to show the various products groupd by manufacturer, eg as shown below;
i have a gridvew on my page as below and above it is a heading. If the gridview is empty
then the page is blank but the header above is still there which does not look right. SO i want to hide the header as well but dont know if I can put the <h1> in the gridview or do i need to call some other code to check if gridview is empy and then hide the DIV??
I want to display my data from sql in a grid view. Here the problem is how do I display more than one columns under one column. For example, I have A, B, C, D, E, F columns in sql and then when displaying in Grid, I want to display as 3 columns A, B, C and under column "B" I want to Display D, E, F.
I have sutmbled across somethig strange. When you ser theYou cannot set the color in a style and apply it to the heading of a grid, it will show in the templated columns, but not in the non-templated columns.
You can set the color for the non-templated columns with the HeaderStyle-ForeColor attribute, but it seems strange for it not to recognize the color in the style and seems redundant to have to specify a style and a color seperately.
Am I doing somethign wrong. Is there some sort of setting I have wrong that is causing this?
I am having problems in getting product data when using different levels of categories. My knowledge of SQL is also very limited.
Here is what i have so far
TABLES Categories CategoryID (PK) int CategoryName nvchar(max) allow null ParentID int allow null Data for this table 1,Soaps,null 2,Original Range,1 3,Premium Range,1 4,Speciality Range,1 5,Seasonal Collection,4 6,Selection,4 Products ProductID (PK) int ProductName nvarchar(max) ProductDescription nvarchar(max) allow null ProductPrice money CategoryID int
Data for this table
1,Prod1,some text,0.25,6 2,Prod2,some text,0.25,6
I have some linq to sql in the page load event that populates a list view,
[Code]....
Now when the category passed in from the query string is 6 then the products with a category of are shown correctly but category 6 is a child category of 4 and 4 is a child of 1 so when i pass in 4 as the category i should still be retrieving the data for products 1 and 2.
public class CountryListViewModel { public IEnumerable Countries { get; set; } } public class CountryViewModel { public string CountryName { get; set; } public string State { get; set; } public IEnumerable<CityViewModel> Cities { get; set; } } public class CityViewModel { public string CityName { get; set; } public string CityLink { get; set; } }
using linq to entity grouping by country and it works as designed. but I also have to group by state.
var query = from c in _db.MyTable where c.IsActive && c.Country == country group c by c.Country into loc select new CountryViewModel() { CountryName = loc.Key, Cities = loc.Select(s => new CityViewModel() { CityName = s.City, CityLink = s.City }).Distinct() };
I have my categories in database, and want something url rewriting/routing to make my url nicer and more SEO friendly. I have divided my categories into the following:
Cars > Select car > Car model >
how do I create url rewriting / routing in my categories? I use framework 4.0
- 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.
I have few monhts working with aspx, and now I'm developing a shopping cart website. For the employee to upload the products on the DB, every product needs to be linked to a category and sub category, and sub-sub category, and so on. Sometimes the sub-sub categories are up to 5. For example Electronics-TV-LCD-Samsung-40 inches.
First, What I would like to identify is if the SQL table has the apporpiate structure. I have 3 columns Id, Description, Parent_Id. Categories with Parent Id=0 is used for the top ones. Is this the best way to do it?
Then I want to use the ListBox control to select main Categories, and once it is selected, filled a second listbox with its childs and so on. Do I need to query SQL DB everytime the change event happens? I heard about linq but have not used yet.
The problem is that we have 5 different categories and we have to calculate the percentage of products sold in each category. Then we have to show that in sort of a chart. The interface of chart is shown here
http://img64.imageshack.us/img64/5397/52805880.gif although this chart has 14 boxes but I will be using 20 boxes in the final chart, the reason for that is that I want each box to represent 5% of sales. Now the question is suppose that the percentage for sales in each category is 34.4%, 12.6%, 23.2%, 22.6% and 7.2%. How do I convert these values to nearest 5 and then fill each box with that color. For example 34.4% means that almost 35% or 7 boxes will be colored with that color. The problem is that the sum of all of these must always be 20. I understand that this will not be very precise representation but this is the demand from the user.
My problem is after I've defined the second sub-level structures, I get duplicated sub-levels of data within the sub-level nodes as opposed to having the data distributed between the 2 sub-nodes with the appropriate corresponding data assigned to each level.
In my database, the 2 top sub-levels are identified by integer values of 1 and 2. So the first 2 sub-level nodes are created using a case statement which creates 2 separate sub-level nodes on the tree as I need. But I am having a problem for how I can get the next levels of data to distribute between the 2 separate sub-levels accordingly???
Its almost like I need a 2 more treeviews within a treeview to accomplish what I'm after but I don't know if this is even possible.
I am trying to create a search filter much like the one used on eBay that dynamically comes up with appropriate search categories based on the search results left. For example: [URL]
As you can see the search filters on the left are based upon the details displayed on the product results.
I need to try and implement something similar for an ASP.NET site, whereby I need to filter articles based on fields such as sales, companies, employee numbers etc. My database is quite normalised so I am able to separate all the data into their own tables.
I have a categories table which is set up to allow an infinite number of sub category levels. I would like to mimic the following:It should be clarified that sub categories can have sub categories. E.g. Parent cat -> level 1 -> level 2 -> level 3 etc.My categories table has two columns, CategoryName and ParentID.This list box will be used when assigning the correct category to a product.How can I write this?EditIn response to thedugas I had to modify your answer to work with my situation. I found some errors that needed to be fixed, but below is a final, working solution.
protected void Page_Load(object sender, EventArgs e) { using (DataClasses1DataContext db = new DataClasses1DataContext())
I would like to create a category page in the admin section where the admin can create/add category from the webpage , he/she don't have to go to database to create it how to make this possible by sourcecode in webpage and in database?