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

Discussion in 'ASP .Net' started by Laith Zraikat, Jul 3, 2006.

  1. 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.
     
    Laith Zraikat, Jul 3, 2006
    #1
    1. Advertising

  2. 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 (, 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.
     
    Walter Wang [MSFT], Jul 4, 2006
    #2
    1. Advertising

  3. Laith Zraikat

    Jeeran Guest

    Hello Walter Wang [MSFT],

    It did the job, thanks!

    > 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 (, 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.
    >
     
    Jeeran, Jul 5, 2006
    #3
  4. 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 (, 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.
     
    Walter Wang [MSFT], Jul 6, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doug McCann
    Replies:
    1
    Views:
    1,079
    William Brogden
    Aug 5, 2004
  2. Replies:
    0
    Views:
    550
  3. Replies:
    1
    Views:
    569
    David
    Apr 24, 2007
  4. Nathan Sokalski
    Replies:
    25
    Views:
    1,469
    Nathan Sokalski
    Mar 4, 2010
  5. Russell
    Replies:
    2
    Views:
    301
    Russell
    Sep 13, 2004
Loading...

Share This Page