Setting the Page Title using local resources for a content page in a master page

L

Laith Zraikat

I need to set the page title for a content page in a master page, and do
that using local reources so that I can have my page title in different languages.

I can do that easily using global resources by explicitly setting the value
of the Page, but I want to use local resources as a standard.

Thank you.
 
W

Walter Wang [MSFT]

Hi Laith,

Thank you for your post.

Based on my understanding, your question is how to use local resources to
set the content page's title. If I've misunderstood anything, please feel
free to post here.

Please use following steps to use local resources to set content page's
title:
1) In the folder where the content page resides, create a subfolder
"App_LocalResources" if it doesn't exist yet;
2) In the subfolder, create a resource file named after the content page
file name, for example: "Default2.aspx.resx", and create a resource key
"PageTitle", set its content to your desired page title.
3) In the content page declaration, use following code to use the resource:

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
UICulture="auto" AutoEventWireup="true" CodeFile="Default2.aspx.cs"
Inherits="Default2" Title="<%$ Resources:pageTitle %>" %>

If you want to add additional languages, just add more
"Default2.aspx.??.resx" to the "App_LocalResources" subfolder. You also
need to set UICulture="auto" in the @ Page directive or include a
<globalization uiCulture="auto"/> element in web.config if you need to use
different resources by client browser settings.

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

Walter Wang [MSFT]

Hi,

Appreciate your update and response. I am glad to hear that the problem has
been fixed. If you have any other questions or concerns, please do not
hesitate to contact us. It is always our pleasure to be of assistance.

Have a nice day!

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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