Menu Control with Multiview Control ???

B

Brad Isaacs

Good morning friends,

I am working with ASP.NET 2.0 -- VB code behind

I have created tabbed pages using the Menu control with the Multiview
control. Using the menu control to display the tabs, and the Multiview
control to display the content that corresponds to the selected tab.

My Menu control needs to be able to switch language from English or French
depending on the language chosen by the user.

At the moment I have hard coded the Text: area to the English language.

I tried to dump asp code to pick either ENG language or FRE depending on the
page lang="en" or page lang="fr"
<%

If Request.QueryString("lang") = "en" Then

%>

However I receive an ::::::::::::::::::: Error: ASP.NET
Runtime..........Code blocks are not supported in this context.

My question is,

Is there a way to access the Text portion of the Menu control to switch
languages from English to French on the Source side of the code OR should I
try and access it through the vb.aspx code side of things? And how may I
chnage it back and forth.

Please see below....................


My Menu control CODE:
<asp:Menu

id="menuTabs"

CssClass="menuTabs"

StaticMenuItemStyle-CssClass="tab"

StaticSelectedStyle-CssClass="selectedTab"

Orientation="Horizontal"

OnMenuItemClick="menuTabs_MenuItemClick"

Runat="server" Width="370px" BackColor="Transparent"
DynamicHorizontalOffset="2" Font-Names="Arial" Font-Size="0.8em"
ForeColor="Transparent" StaticSubMenuIndent="10px" Font-Bold="True"
Height="20px" BorderColor="Transparent">

<Items>

<asp:MenuItem

Text="ENGLISH FIRST SECTION" <<<<< --- Need to have this change to
Value="0"

Selected="True" />

<asp:MenuItem

Text="ENGLISH SECOND SECTION" <<<<< --- Need to have this change to
Value="1"/>

<asp:MenuItem

Text="ENGLISH THIRD SECTION"<<<<< --- Need to have this change to
Value="2" />

</Items>

<StaticMenuItemStyle CssClass="tab" HorizontalPadding="5px"
VerticalPadding="2px" />

<StaticSelectedStyle CssClass="selectedTab" BackColor="White" />

<DynamicHoverStyle BackColor="Transparent" />

<DynamicMenuStyle BackColor="Transparent" BorderColor="Transparent" />

<DynamicSelectedStyle ForeColor="Black" />

<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />

<StaticHoverStyle BorderStyle="Solid" Font-Bold="True" />

</asp:Menu>

Any ideas would be greatly appreciated,

Thanks in advance,

~Brad
 
B

Brad Isaacs

Can you elaborate?

Localization........my web site uses localization, only the Menu control
does not hold TEXT inside its Expressions in order to use my localization.

Do you have an example, can you reference me to a tutorial......or any ....?
 
C

clintonG

// the following search term is all I can suggest...
localizing the asp.net menu control site:msdn2.microsoft.com

<%= Clinton
 
B

Brad Isaacs

Hi Clinton,

Thanks for your help.

~Brad

ps: Kool Google map of where you are........& web site~
 
B

Brad Isaacs

Hi Clinton,

When I first tried to insert the Resource file tags into my menu control
code blocks, I had made a typo unknowingly....hence the error.

As I thought, it was a simple fix..................

<asp:MenuItem

Text="<%$ Resources:Resources, FirstTab %>"

Value="0"

Selected="True" />

<asp:MenuItem

Text="<%$ Resources:Resources, SecondTab %>"

Value="1"/>

<asp:MenuItem

Text="<%$ Resources:Resources, ThirdTab %>"

Value="2" />

</Items>


Thanks again,

~Brad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top