Hi, so I have to create a dynamic menu which is created using <ul><li><a href /></li></ul> etc. The menu has to be dynamic based on the user who is viewing the page. So far when the page loads I send the name of the user logged in, to a stored procedure, the stored procedure then sends back a list of the menu items available for that user. I don't know how to code this so that the items are added to the list of items. Any pointers would be great. Thanks
coder91
0
Junior Poster
Recommended Answers
Jump to PostHi
Is this ASP.NET WebForms or MVC? The following approach (may not be the best) is based on WebForms as you mention page load and just presents the concept of adding your own markup from the code behind. If it is MVC then there are much easier ways of doing …
Jump to PostJust to add... asp.net does have a navigation menu control you can use and it can be dynamic in nature, but I really dont care for it. I would suggest djjeavons approach. The only difference i may suggest is that instead of using a div, i may just using a …
Jump to PostHi
When you build your <a href> you need to append the additional information to the link. For example:
<a href=Report.aspx?ReportID=" & yourID & "&SomeOtherValue=" & someOtherValue & "&AnotherValue=" & AnotherValue & ">LinkText</a>
Then, when Report.aspx page loads you can grab the query string values using
Request.QueryString("ReportID")
orRequest.QueryString("SomeOtherValue")
HTH
All 9 Replies
djjeavons
113
partis vestri scientia
JorgeM
958
Problem Solver
Team Colleague
Featured Poster
coder91
0
Junior Poster
djjeavons
113
partis vestri scientia
coder91
0
Junior Poster
djjeavons
113
partis vestri scientia
coder91
0
Junior Poster
djjeavons
113
partis vestri scientia
coder91
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.