Creating a server side menu

I create my menu using javascript. How possible is it that when the page loads, it is created on the server side (VB ASP.NET), and not on the client side? And if possible, how is this done? My main goal is to create menu items from the database.

Feel free to give your opinion.

+3
source share
2 answers

You can look at micro-templating where you create a template that uses json as a data source. This way you can manage menu items using a database query, xml, whatever. A template is a good feature, since you don’t have to rebuild and redeploy it if you want to change the look. There are several examples of asp.net:

Dave Ward Encosia Blog

Rick Strahl's Blog

fooobar.com/questions/32351 / ...

+3
source

It is very simple, there are many ways to do this, but basically you use asp.net vb code that outputs HTML and / or even some JavaScript many ways to do this, simplified:

Response.Write("<div class='mymenu'>")
Response.Write("<ul>")
Response.Write("<li>Menu Item 1</li>")
Response.Write("<li>Menu Item 2</li>")
Response.Write("<li>Menu Item 3</li>")
Response.Write("<li>Menu Item 4</li>")
Response.Write("</ul>")
Response.Write("</div>")

, . - , , ... , , .

javascript , , , .. .

0

All Articles