so I used "me.page.resources.resource.NAME" in code behind page.
but I want to use that NAME in
<%
@ Page
Language="VB"
MasterPageFile="~/Master.master"
AutoEventWireup="false"
CodeFile="Default.aspx.vb"
Inherits="DefaultPage" Title="<%$ Resources:resource,NAME %>"%>
Is there any way????
<%$ Resources:resource,NAME %>=Yahoo + "Page" i.e. Yahoo Page
it would not allow to append "Page" in Page directive... so, better to have another string resource for Page titles or try it in code behind (page_load) event...
sachin_07
Member
197 Points
114 Posts
Page Title from Resource file...
Jan 21, 2008 06:30 AM|LINK
Hello,
I have Resource file...
I am using following code for Display Lable Text...
<
asp:Label ID="lblName" runat="server" Text="<%$ Resources:resource,NAME %>"></asp:Label>and I want to use that name for page title...
so I used "me.page.resources.resource.NAME" in code behind page.
but I want to use that NAME in
<%
@ Page Language="VB" MasterPageFile="~/Master.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="DefaultPage" Title="<%$ Resources:resource,NAME %>"%> Is there any way????Please help me...
Thanks,
Sachin.
vivek_iit
All-Star
17778 Points
3189 Posts
MVP
Re: Page Title from Resource file...
Jan 21, 2008 07:03 AM|LINK
Refer this article for localizing title using auto generated resx files:
http://aspalliance.com/423_Localization_in_ASPNET_20_and_Visual_Studio_NET_2005__Code_free_Localization
You can also set the title in the code behind as shown above.
HTH,
Vivek
Communifire: Social Networking and Business Collaboration Platform
sachin_07
Member
197 Points
114 Posts
Re: Page Title from Resource file...
Jan 21, 2008 07:49 AM|LINK
Hey Thanks Vivek,
I dont want to using Localization here....
I am reading string from App_GlobalResources(Resource.resx) .
here I get Page Title from Resource.resx....
<%@ Page Language="VB" MasterPageFile="~/Master.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="DefaultPage" Title="<%$ Resources:resource,NAME %>"%>But, my problem is... I want to show <%$ Resources:resource,NAME %> + "Page"
e.g. ....<%$ Resources:resource,NAME %>=Yahoo + "Page" i.e. Yahoo Page
If I use Title="<%$ Resources:resource,NAME %>" It shows page title as it is..
Thanks 1s again,
Sachin.
kaushalparik...
All-Star
26580 Points
3693 Posts
MVP
Re: Page Title from Resource file...
Jan 21, 2008 08:38 AM|LINK
it would not allow to append "Page" in Page directive... so, better to have another string resource for Page titles or try it in code behind (page_load) event...
C#
this.Title = Resources.Resource.NAME + " Page";
VB
Me.Title = Resources.Resource.NAME & " Page";
[KaushaL] || BloG || Twitter
Don't forget to click "Mark as Answer" on the post that helped you.
sachin_07
Member
197 Points
114 Posts
Re: Page Title from Resource file...
Jan 21, 2008 08:44 AM|LINK
Hey Thanks KaushaL....
Yes, I did that....
But I want to do in .aspx page(<%@ Page %> tag...[:)] )
Thanks.
sachin_07
Member
197 Points
114 Posts
Re: Page Title from Resource file...
Jan 22, 2008 05:50 AM|LINK
Hello,
Any 1 nos about this.............
satishambiti...
Member
48 Points
18 Posts
Re: Page Title from Resource file...
Jan 25, 2008 08:50 AM|LINK
Hi Sachin,
Do it as the following way
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title id= "TestPage" title="<%$ Resources:resource,NAME %> + page"">Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
I think it will help you..
Thanks,
Satish.
sachin_07
Member
197 Points
114 Posts
Re: Page Title from Resource file...
Jan 28, 2008 02:46 AM|LINK
Hey Thanks Satish...
Yes, I did that....
But I want to do in .aspx page(<%@ Page %> tag...
)
Thanks 1s again.....
Absolute_Zer...
Member
38 Points
49 Posts
Re: Page Title from Resource file...
Feb 02, 2008 04:01 PM|LINK
Sachin, did you ever find the solution to this? I would like to accomplish the same thing by putting it within the page directives at the top.
Thanks,
zero
sachin_07
Member
197 Points
114 Posts
Re: Page Title from Resource file...
Feb 03, 2008 12:40 PM|LINK
Still No zero [:(]