Re: loop througth Literials using foreach!!

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: DalePres (don-t-spa-m-me_at_lea-ve-me-a-lone--.com)
Date: 02/11/05


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??
>>>
>>
>>
>
>



Relevant Pages

  • Re: loop througth Literials using foreach!!
    ... I want to loop throught literials so i don't use ... > In order to get the Literals to work, I had to create them, instantiate ... and them to Page.Controls from within my codebehind. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Cannot instantiate EnvDTE.DTEClass class
    ... if you target on the Visual Studio 2003's ... IDE, you may use the following code snippet to instantiate the VS2003's ...
    (microsoft.public.vsnet.ide)
  • Visual Studio 2003 DTE problem
    ... I am encountering problem when i try to instantiate a 'SolutionClass' ... I had installed DotNet framework1.1 and Visual Studio 2003 on a clean m/c. ... installation that i missed?????I could make out that the progId has been ...
    (microsoft.public.vsnet.ide)