Making an attribute similar to meta:resourcekey

  • Thread starter Emil Christopher Melar
  • Start date
E

Emil Christopher Melar

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top