I am currently developing a blog for myself and my friends, (with some special features, why i am not using those free blogs)
As all blogs there is a left (or right) menu where you can find for example: presentation, blog archive, 10 last blog entries, 10 last comments, images, links, etc.
Every user can change the menu, and order each item as they want to.
But I dont know how to do this in the correct way.
At the moment I create new divs and use a for each to add .innerHtml content.
I guess this is not the best way…
Is there a way to change position of repeaters, or panels on a page?
Or is there some other ways to do this?
—-Edit:—-
I got one minus for this post so I guess I have to explain my problem a bit more!?
The code for the “menu to the left” is put inside the masterpage.
And I have a lot of functions that create each part of the menu.
createShortPresentation();
create10LastPosts();
create10lastComments();
...
And instead of using repeaters which I would use if the order of each menu item (presentation, image, 10 last posts…..) was static I just use one panel for the left menu. And that panel I fill with html by each of the functions. The ID of the panel for the left menu is: leftMenuDiv
For example, the create10LastPosts(), where last10PostsData is datatable from database.
leftMenuDiv.innerHtml +="<div class="last10Posts">";
for each last10PpostsData
{
leftMenuDiv.innerHtml += "Name of the post & href and stuff to create the link";
}
leftMenuDiv.innerHtml += "</div>";
I dont like this approach, and would like to use repeaters instead, but then I have to put them in an static order.
What should I do?
Any questions?! Please reply if there is something missing.
Try separating each “menu to the left” element into a separate user control (which will allow you to use repeaters). Then depending on what the order of the menus are, you can dynamically load each user control into a placeholder. Is this the direction you want to go?