Re: loop througth Literials using foreach!!
From: Scott Allen (scott_at_nospam.odetocode.com)
Date: 02/11/05
- Next message: JP: "Re: Exception Handling in Global.asax"
- Previous message: Andy Sutorius: "Re: Could not load type 'psyche.admin.justdoit'."
- In reply to: Islam Elkhayat: "Re: loop througth Literials using foreach!!"
- Next in thread: Islam Elkhayat: "Re: loop througth Literials using foreach!!"
- Reply: Islam Elkhayat: "Re: loop througth Literials using foreach!!"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 11 Feb 2005 16:39:23 -0500
How do you currently load the resource manager? Can't you expose the
resource manager as a property of the form, or grab a reference from a
static helper property / method?
-- Scott http://www.OdeToCode.com/blogs/scott/ On Fri, 11 Feb 2005 20:37:27 +0200, "Islam Elkhayat" <islamegy@yahoo.com> wrote: >I tried to create new control drived from Literial... >I add the Key property and in the render method i Can't assign the base.Text >to the ResourceManager Getstring() of my main application form.... >Do i have to load my assembly & resouce manager in the new control?? > > >"Scott Allen" <scott@nospam.odetocode.com> wrote in message >news:fm2o019au8if3roq6mrrsgms0mu4droi5q@4ax.com... >> If there is a literal control on the page, the control has to be >> instantiated to render. Perhaps you meant you didn't want to declare a >> variable for each Literal control? >> >> In any case, I think a cleaner solution would be to create a new >> control (pehaps derived from Literal or WebControl) and use the Init >> event to get the string from a resource file. You could add Key as a >> public property to be able to assign the key from inside the ASPX tag. >> >> The above approach will be a cleaner, more maintainable solution. >> You'll be able to use the new control on any page in your application >> without cluttering eeach page with the string loading logic. >> >> HTH, >> >> -- >> Scott >> http://www.OdeToCode.com/blogs/scott/ >> >> On Fri, 11 Feb 2005 03:13:07 +0200, "Islam Elkhayat" >> <islamegy@yahoo.com> wrote: >> >>>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: JP: "Re: Exception Handling in Global.asax"
- Previous message: Andy Sutorius: "Re: Could not load type 'psyche.admin.justdoit'."
- In reply to: Islam Elkhayat: "Re: loop througth Literials using foreach!!"
- Next in thread: Islam Elkhayat: "Re: loop througth Literials using foreach!!"
- Reply: Islam Elkhayat: "Re: loop througth Literials using foreach!!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|