I've got a piece of code that should generate a menu with subitems from a datasource. The menu is displaying without errors but de submenu items are presented as menuitems. Can't figure out whats wrong:
Dim sqlMenuRdr As SqlDataReader = objDbMenu.GetDbMenuItems.ExecuteReader
Dim sqlSubMenuRdr As SqlDataReader = Nothing
Dim i As Integer = 0
In my website I'm using the standard ASP.NET menu control. I already got so far as to write a custom control adapter to get rid of the rather tacky html output that is generated by the default control adapter.
One thing keeps buggering me though. Somehow ASP.NET is generating extra javascript that I don't want nor need for my menu controls, since I won't be using any of the dynamic features in the control. I replaced the control adapter, so it doesn't generate compatible HTML for that.
how I can prevent ASP.NET from generating the extra javascript for the menu control?
<ul class="sf-menu"> <li class="current"> <a href=Furniture.aspx">Furniture</a> <ul> <li class="current"> <ul> <li class="current"><a href="Furniture.aspx">kitchen</a></li> <li><a href="Furniture.aspx">Electric</a></li> <li><a href=Furniture.aspx">Furniture</a></li> </ul></li>  I want when user click one of item from menubar it go to Furniture.aspx and when it go to that page in furniture.aspx show my product related to that item i have Product table in my DB
Id Code Name Description H_name
1 1112 Iron This is test Electric 2 1113 Pot This is test Kitchen 3 1114 Chair This is test Furniture 4 1115 Laundry This is test Electric 5 1116 Container This is test Kitchen 6 1117 Sofa This is test Furniture
I want when user click on Kitchen from menubar in furniture.aspx show product that have H_name=Kitchen  or if they click on Electric item from menubarin  furniture.aspx show my product that have H_name=ElectricÂ
I am trying to populate menu from database in asp.net 3.5 but as i am new to this technology i really don't know what is the exact way. I tried to find out on web but i found nothing useful for me.
I am developing site for bookstore.First i want to populate departments and then in department, their categories as subitem.
I have both the tables in database.
I tried following code but it is giving me an erroe on relation code line
This constraint cannot be enabled as not all values have corresponding parent values.
All departments dont have categories.
code :
DataSet DepartmentData = new DataSet(); DataTable Department = CatalogAccess.GetDepartments(); DataTable Categories = CatalogAccess.GetCategories(); DepartmentData.Tables.Add(Department); DepartmentData.Tables.Add(Categories); DepartmentData.Relations.Add("Children", DepartmentData.Tables[0].Columns["DepartmentId"], DepartmentData.Tables[1].Columns["CategoryId"]); foreach (DataRow item in DepartmentData.Tables["Department"].Rows) { MenuItem DepartmentItem = new MenuItem((string)item["Name"]); DepartmentItem.ChildItems.Add(DepartmentItem); foreach (DataRow childItem in item.GetChildRows("Children")) { MenuItem childrenItem = new MenuItem((string)childItem["Name"]); DepartmentItem.ChildItems.Add(childrenItem); } } Departments.DataBind();
and how to add navigation url too!
I can use any other logic but i want to know the better way to code this from expert.
In classic ASP I would write some logic to get a nice menu on the site, but now with the Menu-control, it's as easy as it gets.. Maybe to easy. I can't quite figure out how I would do this.. I have a multilevel navigation structure (from a database) that I want to put into the Menu-control, but I don't know which approach is the best/easiest way for me..
I'm all into performance, usability and all that.. The only thing I have really decided is that I want to use the Menu-control, I haven't decided what datasource I should use or how to style the individual links my way The data is coming from a database and is not supposed to be changed very often (maybe once or twice every month).. Thought of making an XML-sitemap, but also of making some sort of SQL-hookup.. I'm leaning towards the XML-sitemap because it wouldn't take long to generate the XML every time the navigation changes and that won't happen very often. The next issue is styling, how to do that? I have the neccesary css ready for the individual links, but I'm still unsure of how to get it to the Menu-control.. The css I have looks like below and in its current form is intended just for the anchors
i have created menus using menucontrol (populated using database) its showing me menu items properly.now menu items goes out of screen (viewing area of the screen)i want to wrap that menu items means if the menu items goes out of the screen it will automatically shows the remaining menu items to the next line... and i have taken menucontrol in span tag..
I a method that generates a PDF and the method returns a byte value, but after response.end statement, the shows an error that the "File does not begin with '%PDF-' here is the code:
I'm writing out lots of checkbox controls dynamically based on a query result. In a subsequent sub, I need to check some of those boxes based on another query.
So, in my first sub I have this in my reader loop:
[Code]....
In my second sub, I get the IDs for those boxes that need to be checked.
How do I reference the dynamically generated checkboxes from here? Something like:
can anyone tell me how to solve this issue Assembly generation failed -- Referenced assembly 'Microsoft.Web.UI.WebControls' does not have a strong name
I am trying to add some code that logs to a table the time a page has taken to generate, from the request coming in to the response given back. The easiest way to do this is through our master page as it can add the timings of every page.Where I'm a little unsure, is when to put the start and end timings.Currently, I set the start time in the page.unload and the end time as the last part of the page.load on the master page.The figures coming back seem ok, but I'm not sure if I am picking the earliest and latest possible times to get my timings?
How to Create a function for Prefix generation on each insert row ?I have a table with ID as primary and is identity and increment by 1. and POID another column.Now I need to generate a function like this.In POID Column on each insert I need to set prefix like this
I am an newbie to this technology. I had requirement kind of thing, like, I had 5 cascading drop downs, which I created by using ajax control tool kit drop-down extenders, and used web-service to update the cascading drop downs content.
In the same form I need to create a grid, so based upon selection of the user, the grid should change dynamically, like I would like to have some examples kind of things, lets say, I had Four cascading drop- downs, like 1) Vehicles, 2) Hotels 3)Games 4) Year
And those can be sub-categorized to
1) Vehicles ----- Three Wheelers, Two Wheelers, Four Wheelers 2) Hotels -------- Five Star Hotels, Luxurious Hotels, Restaurants, Bars, Pubs 3) Games ------- Play Stations, Video Games 4) Year ----------- Manufactured or established in that particular year
so, If the user selects vehicles, then we need to show all the information regarding vehicles, and if he selects hotels , we need to get the information of vehicles, and hotels( * note, I may not be able to give u the right example, once again i want remind you that these drop downs were cascading drop downs, based upon one selection, other works) and like wise if he selects year, we need to show information of all the things manufactured or established in that particular year and here year is not a cascading drop down, and all these information is maintained in a single database table
And currently I am using Microsoft Sql Server 2008 R2, Visual Studio 2008, Using c#, ( i would be happy, if anyone gives me a code kind of thing, not mandatory, only if possible)...
Is there a way to add/delete/update the default classes (for instance AspNet-Menu-WithChildren,AspNet-Menu-NonLink ) of the html generated by the asp.net menu or treeview control? I am using CSSAdapters so the menu control renders in a list format instead of table format.
I am trying to style the menu control to allow the menu items to float to the right of the container, however I am unable to do so as whenever I am styling the a, ul or li it keeps getting overidded by asp.net and floats everything left.