Home All Groups Group Topic Archive Search About

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

Author
3 Jul 2006 1:01 PM
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.

Author
4 Jul 2006 7:48 AM
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 (waw***@online.microsoft.com, 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.
Are all your drivers up to date? click for free checkup

Author
5 Jul 2006 3:07 PM
Jeeran
Hello Walter Wang [MSFT],

It did the job, thanks!

Show quoteHide quote
> 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 (waw***@online.microsoft.com, 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.
>
Author
6 Jul 2006 1:23 AM
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 (waw***@online.microsoft.com, 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.

Bookmark and Share