Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How to build dynamicaly a menu in ASP.Net 2.0 (VS 2005) ?

Reply
Thread Tools

How to build dynamicaly a menu in ASP.Net 2.0 (VS 2005) ?

 
 
MarioSerrano
Guest
Posts: n/a
 
      11-17-2005
I have a menu (new feature of framework 2.0) in an Web application. The thing
is, that i already have a function to create a dynamic menu. And it works...
but the issue is that it doesnt want to show at the page...

HTML code...
<asp:Menu ID="Menu1" runat="server" BackColor="#FFFBD6"
DynamicHorizontalOffset="2"
Font-Bold="True" Font-Names="Verdana"
Font-Size="XX-Small" ForeColor="#990000"
Orientation="Horizontal"
StaticSubMenuIndent="10px" Width="37px" BorderStyle="Groove" >
<StaticMenuItemStyle HorizontalPadding="5px"
VerticalPadding="2px" />
<DynamicHoverStyle BackColor="#990000"
ForeColor="White" />
<DynamicMenuStyle BackColor="#FFFBD6" />
<StaticSelectedStyle BackColor="#FFCC66" />
<DynamicSelectedStyle BackColor="#FFCC66" />
<DynamicMenuItemStyle HorizontalPadding="5px"
VerticalPadding="2px" />

<StaticHoverStyle BackColor="#990000"
ForeColor="White" />
</asp:Menu>


// Heres the code

protected void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
this.Menu1 = BuildMenu(mySessionVariable);
}
}

// As you can see ,at html code i dont create menu items... even if i
create menu // items it still doesnt show my created menu ... i dont know
what i am missing
// im new at vs 2005 and im meeting some differences between frameworks
// 1.1 and 2.0... may be its a little issue... hope u can help me


thanks

Mario Serrano Flores
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
clintonG
Guest
Posts: n/a
 
      11-20-2005
Uh, how could a menu control work if it can't be seen in the page?
Secondly, your Page_Load event only loads the control if the page is not a
PostBack. How is the control loaded when the page IS a PostBack or when the
page is first loaded?

<%= Clinton Gallagher

"MarioSerrano" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a menu (new feature of framework 2.0) in an Web application. The
>thing
> is, that i already have a function to create a dynamic menu. And it
> works...
> but the issue is that it doesnt want to show at the page...
>
> HTML code...
> <asp:Menu ID="Menu1" runat="server" BackColor="#FFFBD6"
> DynamicHorizontalOffset="2"
> Font-Bold="True" Font-Names="Verdana"
> Font-Size="XX-Small" ForeColor="#990000"
> Orientation="Horizontal"
> StaticSubMenuIndent="10px" Width="37px" BorderStyle="Groove" >
> <StaticMenuItemStyle HorizontalPadding="5px"
> VerticalPadding="2px" />
> <DynamicHoverStyle BackColor="#990000"
> ForeColor="White" />
> <DynamicMenuStyle BackColor="#FFFBD6" />
> <StaticSelectedStyle BackColor="#FFCC66" />
> <DynamicSelectedStyle BackColor="#FFCC66" />
> <DynamicMenuItemStyle HorizontalPadding="5px"
> VerticalPadding="2px" />
>
> <StaticHoverStyle BackColor="#990000"
> ForeColor="White" />
> </asp:Menu>
>
>
> // Heres the code
>
> protected void Page_Load(object sender, System.EventArgs e)
> {
> if (!IsPostBack)
> {
> this.Menu1 = BuildMenu(mySessionVariable);
> }
> }
>
> // As you can see ,at html code i dont create menu items... even if i
> create menu // items it still doesnt show my created menu ... i dont know
> what i am missing
> // im new at vs 2005 and im meeting some differences between frameworks
> // 1.1 and 2.0... may be its a little issue... hope u can help me
>
>
> thanks
>
> Mario Serrano Flores
> (E-Mail Removed)



 
Reply With Quote
 
 
 
 
MarioSerrano
Guest
Posts: n/a
 
      11-20-2005
Uh,mm...

i fixed the problem....

i had to send the menu into the function like this...


BuildMenu(mySessionVariable, this.Menu1);


... i really dont know why the function didnt assign correctly the built
menu...
but this way worked fine... hope somebody can explain why ...


thanks = )
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
SWsoft Acronis Disk Director Suite 9.0 Build 508, Acronis OS Selector 8.0 Build 917, Acronis Partition Expert 2003 Build 292, Acronis Power Utilities 2004 Build 502, F-SECURE.ANTI vIRUS.PROXY v1.10.17.WINALL, F-SECURE.ANTI vIRUS v5.50.10260 for CITRI vvcd Computer Support 0 09-25-2004 01:38 AM
Dynamicaly create javascript file and cache on client moondaddy ASP .Net 7 02-12-2004 01:06 AM
Adding style sheet dynamicaly Marc Nederhoff ASP .Net 2 11-05-2003 04:56 PM
how to make a group of dynamicaly radio buttons Bisser Milanov ASP .Net 2 06-26-2003 08:01 PM



Advertisments