Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 8th, 2007, 07:17 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default meta:resource key in skin file

Hi

I am using meta:resource key in skin file but it is not working .. can any one help me..

thanks in advance


  #2 (permalink)  
Old August 8th, 2007, 08:23 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Can you be more specific? Perhaps post the code in question.
  #3 (permalink)  
Old August 9th, 2007, 01:39 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Thanks for reply..
scenario is .

1. I have a label in default.aspx page-as
  <asp:Label runat="server" ID="_hell" ></asp:Label>

2.setting of this label are defined in my skin file as-

<asp:Label runat="server" meta:resourcekey="_hellResource1" BackColor="Beige"></asp:Label>

3.I am using two local resource files to get the value of this label at runtime according to language setting.

    a.Default.aspx.resx
            _hellResource1.Text=bye;

    b.Default.aspx.el.resx
            _hellResource1.Text=Hi;

I was thinking that at run time my default.aspx will use my skin class label and from there will get meta:resourcekey and thus according to meta:resourcekey the text of label would come.. But this is not happening.

skin file is not supporting meta:resourcekey attribute.

plz help me why this is not happening or if you could tell me any alternative for it.

A lot of Thanks in advance.

Bye.
Plz


  #4 (permalink)  
Old August 9th, 2007, 02:15 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by planoie
 Can you be more specific? Perhaps post the code in question.

Hi,

Thanks for reply..
scenario is .

1. I have a label in default.aspx page-as
  <asp:Label runat="server" ID="_hell" ></asp:Label>

2.setting of this label are defined in my skin file as-

<asp:Label runat="server" meta:resourcekey="_hellResource1" BackColor="Beige"></asp:Label>

3.I am using two local resource files to get the value of this label at runtime according to language setting.

    a.Default.aspx.resx
            _hellResource1.Text=bye;

    b.Default.aspx.el.resx
            _hellResource1.Text=Hi;

I was thinking that at run time my default.aspx will use my skin class label and from there will get meta:resourcekey and thus according to meta:resourcekey the text of label would come.. But this is not happening.

skin file is not supporting meta:resourcekey attribute.

plz help me why this is not happening or if you could tell me any alternative for it.

A lot of Thanks in advance.

Bye.
Plz


  #5 (permalink)  
Old August 9th, 2007, 08:37 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I'm not an expert on skins, just started using them myself. But I suppose the problem is that you are supposed to define instance specific type information for controls in the skin.

If what you were trying worked, then EVERY label in your application would have the same text. Is this what you are looking to achieve?

Use the skin to set generic properties, like style attributes but leave the specifics up to the individual instances. You want to create the same label that is used in many places that you would need to apply many of the same instance property values to, create a user control. They are there for just this purpose.

-Peter


Similar Threads
Thread Thread Starter Forum Replies Last Post
Title , Meta Keyword , Meta Description dynamic shaileshk ASP.NET 1.x and 2.0 Application Design 8 August 21st, 2007 01:10 AM
warning from dotted notation in resource key Linden BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 July 19th, 2007 03:58 PM
Resource File kk_kumar99 Beginning VB 6 3 October 23rd, 2006 04:32 AM
help help! meta file error! yokel BOOK: ASP.NET Website Programming Problem-Design-Solution 1 July 6th, 2004 12:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.