473,395 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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


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.
Jul 3 '06 #1
3 5346
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 (wa****@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.

Jul 4 '06 #2
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 (wa****@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.

Jul 5 '06 #3
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 (wa****@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.

Jul 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nathan | last post by:
Hi, I seem to having a peculiar problem with the display of odd and even pages in XSL-FO. Here is a small background of the problem. My xsl stylesheet mentions my fo:layout-master-set as ...
2
by: dotnetjose | last post by:
Hi Folks, My subject message pretty musch explains it. By Default the Form definition sits at the Master Page file. Is there a way I can access the setting from my Content Page that uses a...
2
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no...
1
by: GTB | last post by:
Hi, I have a master page, with a single content placeholder. I create a content page for it with some appropriate content. At this point everything is working fine. However I need to change...
3
by: Mike P | last post by:
How do you set the title of content pages? I can set the title of my master pages, but I want each of my content pages to have a different title. *** Sent via Developersdex...
6
by: Rippo | last post by:
Is it possible to turn off the title tag in the page directive when using master pages? We have got meta data and title defined in a content control and are ending up with 2 title tags, one...
8
by: Amit | last post by:
I have a master page and a content page but the stylesheet isnt getting applied like how it looks in visual studio design view. The master page is defined like this: <%@ Master Language="VB"...
1
by: Asif | last post by:
Hi All, I did follow the MSDN article (http://msdn2.microsoft.com/en-us/ library/ms379585(VS.80).aspx ) for overriding Master Page properties by setting page title and other Meta information(...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.