HighTechTalks DotNet Forums  

Making an attribute similar to meta:resourcekey

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Making an attribute similar to meta:resourcekey in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Emil Christopher Melar
 
Posts: n/a

Default Making an attribute similar to meta:resourcekey - 02-22-2006 , 07:05 AM






What i want is a more elegant way to assign _global_ resource strings.

I can see that ControlBuilder is doing things with it.

So I tried to inherit it and parse / remove attributes myself, but I
found out that I couldn't do that.



My method would be doing something like this:

<asp:Label id="lol" runat="server" r:TextKey="Test" />
...

<asp:HyperLink id="lol" runat="server" r:TitleKey="Test" TextKey="Test />

The resource string file would be defined in a static manner
(application_start / web.config)

Parsing description:

"r:" is attribute prefix like "meta:"

Title will be extracted from r:TitleKey

r: is the prefix, will be filteret out. Key is what it should end with,
and will be filtered out.
Now you are left with the attribute value which is "Test", and the
property where you will assign it to, which is "Title".

So then in some funny way, I want to at some point to use reflection to
assign the resource key of "Test" on property "Title" on that control
instance.

Is this doable in any elegant way?

--
Emil Christopher Melar

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.