What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 8213 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > bind sub menu with database ...
Rimjhim_3

bind sub menu with database

Replies: 2 | Posted by: Rimjhim_3 on 10/4/2012 | Category: ASP.NET Forums | Views: 628 | Status: [Member] | Points: 10  


how to bind menu from database in asp 2.0?
after this i want to display sub menu on the mouse hover in the menu items?
after this i want to display sub sub menu on the mouse hover on the sub menu items?
thanks in advance


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Wadhwanisanju
Wadhwanisanju  
Posted on: 10/4/2012 9:47:40 AM
Level: Starter | Status: [Member] | Points: 25

Hello,

Its very easy task not a big deal.

Now i ll show you how to achieve nested upto n-level menu dynamically with SQL Server.

Step 1:

Create a table called "Menu" having following Cols.

-- MenuID,
-- MenuName
-- Desc,
-- ParentID (nullable or 0 by default)
-- URL

Step 2 :

Load this data into dataset via select query into dataset.

DataSet ds = new DataSet();

ds = db1.ExecuteDataSet(command1);
ds.DataSetName = "Menus";

ds.Tables[0].TableName = "Menu";
DataRelation relation = new DataRelation("ParentChild",

ds.Tables["Menu"].Columns["MenuID"],
ds.Tables["Menu"].Columns["ParentID"]., true);

relation.Nested = true;

ds.Relations.Add(relation);

xmlDataSource.Data = ds.GetXml();


Now you will get the XML Structure having nested relation inside. Just try to bind this XML Structure with Menu Control of .NET and see the result.

IF YOU SATISFY BY THIS ANS PLEASE MAKE SURE MARK AS ANSWER.

Rimjhim_3, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Rimjhim_3
Rimjhim_3  
Posted on: 10/5/2012 7:40:20 AM
Level: Starter | Status: [Member] | Points: 25

i m new in asp..............
can u please send me the source file????????

Rimjhim_3, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/25/2013 10:59:44 AM