|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Setting the Page Title using local resources for a content page in a master pageI 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. 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. 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. > 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.
Other interesting topics
Pattern/ help wanted for Request
Report Viewer deployment hash codes of passwords as query string? HOW TO READ ARRAY OF STRUCTURES FROM COM using C# DATE Format Passing Data Between Forms Web From, Twain and ActiveX how to upgrade existing ASP NET applications WebClient Class throwing exception Need Asp.Net .....Help..... |
|||||||||||||||||||||||