CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: Date Entered: 2/6/2006 3:39:21 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 5 Views: 25 Favorited: 0 Favorite
6 Items, 1 Pages 1 |< << Go >> >|
"daniel_rh" <>
NewsGroup User
Autogenerated menus in one page2/6/2006 3:39:21 PM

0

Hi, I have a problem with the ASP:Menu control from ASP.NET 2.0, I'm new on this so I have no idea how to do this...

I have a code that generates a menu for every record in my DB the problem is that every Menus have the same ID and only works the first one, I tried with ID="MenuControl<%=RS("id")%>" but didn't work, ID="MenuControl" & i and didn't work. How I do to change the Menu's ID for each one?

While RS.EOF=False

<asp:Menu runat="server" ID="menucontrol" BackColor="#B5C7DE" Font-Size="0.8e...>

Wend

Sorry my bad english.


DRH
"dannychen" <>
NewsGroup User
Re: Autogenerated menus in one page2/6/2006 4:55:59 PM

0

If you don't set the ID, it will autogenerate a unique ID.  Ordinarily this isn't recommended because it makes it difficult to use the ID as an identifier.  However, in your case, it might be warrented. 
--
Danny
disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
"daniel_rh" <>
NewsGroup User
Re: Autogenerated menus in one page2/6/2006 5:13:42 PM

0

It didn't work Sad [:(]
DRH
"dannychen" <>
NewsGroup User
Re: Autogenerated menus in one page2/6/2006 8:54:32 PM

0

Can you share some of the code you use to actually generate the Menu's, it appears that you are giving us some psuedo-code above for your actually process.  I'd need to see what you're doing to give you a better answer.
--
Danny
disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
"daniel_rh" <>
NewsGroup User
Re: Autogenerated menus in one page2/7/2006 4:31:55 PM

0

Ok, here is it...

<%...

RS=Conn.Execute("SELECT id,codigo,nombre,telefono1,telefono2,celular,direccion,ingreso,nacimiento FROM clientes WHERE nombre LIKE '" & TXTCriterio & "' AND id >=" & LReg  & " ORDER BY id ASC LIMIT 11")

%>

...HTML Code...

<%
X=1
While RS.EOF=False AND X<=10
   ClienteID=RS("id").Value%>

<asp:Menu runat="server" id="menu1"><Items><asp:MenuItem Text="New Item" Value="New Item"><asp:MenuItem Text="New Item" Value="New Item"></asp:MenuItem></asp:MenuItem></Items>
</asp:Menu>

<%

RS.Movenext

X=X+1

End While

%>

The code of the menu is not complete but is something like that. When IIS render the page to HTML all the menus have the same ID or Name.


DRH
"dannychen" <>
NewsGroup User
Re: Autogenerated menus in one page2/7/2006 5:18:38 PM

0

That looks vaguely PHPish.  I don't believe inline looping is really supported.  I would suggest that you replace the looping code with a place holder control and most all that code into a function called from Page_Load.  Inplace of the menu you should use the Menu object and MenuItem objects to dynamically create your menu.

An alternative is to replace your data access code with a SqlDataSource and then put the menu in a repeater control or datalist control bound to the SqlDataSource.  That would be my recommendation and that would let you take fuller advantage of the features in ASP.NET 2.0

--
Danny


disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
6 Items, 1 Pages 1 |< << Go >> >|


Free Download:













master pages in different folders

themes problem when localization

a treeview in masterpage that display folders

master page and content place refresh

using relative urls in the menu control

intellisense vs. masterpages & web.config.

problem with treeview control

setting up page styles and themes customizable by the user???

dynamic font (accessibility)

call a function in a masterpage from the child page

how to create msdn likde splitter in masterpage

menus and permissions

problem using findnode method of the treeview

menu

menu control posting back rather than navigating to a url

access value of a user control from master page in content page

accessing properties in master pages when defined at run time

treeview in masterpage - multiple nodes get appened when i just add a node once

display not refreshing when css in theme is updated

is there a way to make the wizard control databound?

search in google

dynamically loading stylesheet from a ms-sql database

search in masterpage

custom sqlsitemapprovider and external links

how do i write a value from c# code behind to a content place holder

adding a menu on the right click on a treenode

findcontrol in a menu's staticitemtemplate

theme creator tool

retain navigation categories and sub category links (session state /cookies?)

master page

deploying global theme

how to: get access to sitemapprovider in masterpage

asp:menu + rollovers, best way to manage all this

how to add data into body tag of master page from content page

<b>disabling childnodes checkboxes</b>

include labels in a master page that are assigned text by pages

treeview: parent node formatting

need to find the value of the dropdownlist in contentplaceholder from menu click in master page

imagebutton problem!

themes and a disbaled button

menu control as second level navigation

setting the title on content pages?

css for web user control

server side subs in master page

masterpages and system.web.ui.webcontrols.menu: an unholy mess!

menu & listbox control conflict

property in masterpage not being bound correctly to controls

how to change style for staticmenuitem level 1

how to set focus on treenode?

css hierarchy

   
  Privacy | Contact Us
All Times Are GMT