Re: loop througth Literials using foreach!!
From: DalePres (don-t-spa-m-me_at_lea-ve-me-a-lone--.com)
Date: 02/11/05
- Next message: Wayne Wengert: "TabIndex"
- Previous message: Scott Allen: "Re: loop througth Literials using foreach!!"
- In reply to: Islam Elkhayat: "Re: loop througth Literials using foreach!!"
- Next in thread: Scott Allen: "Re: loop througth Literials using foreach!!"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 10 Feb 2005 20:00:39 -0600
You can read my blog on strongly typed localization features built into
Visual Studio 2005 at
http://www.dalepreston.com/Blog/Archives/2005_01_29_Archive.html. While the
classes required are created automatically, in Visual Studio 2005, by the
/str switch of the ResGen.exe program, you could generate similar classes
yourself in code.
You could write a strongly typed resource class generator of your own to
read the resource xml key/value pairs. Here's an interesting article that
might help you get started: http://www.thecodeproject.com/csharp/config.asp.
Something you might try is using the VS2005 version of ResGen.exe and create
the strongly typed classes and try them in VS2003. Based on what I've seen,
I think it would work seamlessly or nearly so.
DalePres
"Islam Elkhayat" <islamegy@yahoo.com> wrote in message
news:e6rShb9DFHA.4004@tk2msftngp13.phx.gbl...
>I want to loop throught literials so i don't use
> Lit_1.Text= resources.GetString(key)
> for each literial... if i instantiated every literial in the code behind i
> will write the same long code!!!
> How can i solve this issue??
>
>
> "DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
> news:O39xgU9DFHA.732@TK2MSFTNGP12.phx.gbl...
>> How are you creating your literals? In my tests of your problem, I found
>> that Literals created in the aspx file as <asp:LITERAL> were not
>> available in code even if I made sure that they were declared and
>> instantiated in my codebehind.
>>
>> In order to get the Literals to work, I had to create them, instantiate
>> them, and them to Page.Controls from within my codebehind. Done that
>> way, I was able to access the Literal and manipulate its properties.
>>
>>
>> "Islam Elkhayat" <islamegy@yahoo.com> wrote in message
>> news:OAaOtI9DFHA.3244@TK2MSFTNGP15.phx.gbl...
>>> It didn't throw Exception but also didn't work
>>> if statment always false... so i always go to the else!!
>>>
>>> How can i make it work??
>>>
>>
>>
>
>
- Next message: Wayne Wengert: "TabIndex"
- Previous message: Scott Allen: "Re: loop througth Literials using foreach!!"
- In reply to: Islam Elkhayat: "Re: loop througth Literials using foreach!!"
- Next in thread: Scott Allen: "Re: loop througth Literials using foreach!!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|