K
Kevin Blount
As mentioned before, I'm creating a multi-lingual page where the text of
the page comes from a database. This page includes a registration form
which asks for address information, including the Country.
I have 6 .txt files that contain a complete list of countries that we
sell to (65 in total), each written in the appropriate way for the
language of the site, e.g. Mexico for English US and UK sites and México
for the Spanish language site.
I want to add these countries to a ListBox, changing the .Text of the
ListItem depending on which language the pages is being viewed it.
The problem I think I'll face is that I will have to manually specify 65
ListItem tags and then dynamically set the .Value and .Text for each
one, and that's a lot of work (but if it has to be done, so be it).
I'm wondering if there might be a way to dynamically add new ListItem
tags to my ListBox by opening the .txt file and going through it line by
line until I reach the end.
I have 3 ways/ideas in mind, and wanted to get feedback on them, and
potentially any help/examples of other ways:
1) manually code 65 ListItem tags, 65 "CountryItem45.Value =
txtFileValueEntry;" lines and 65 "CountryItem23.Text =
txtFileTextEntry;" lines;
2) use HTML <select> and <option> tags instead (can I use HTML form tags
inside my ASP.NET runat=server form that uses asp:TextBox tags already,
i.e. mix between .NET and HTML in the same form?)
3) open the .txt file and for each line read create a new ListItem and
set it's .Value and .Text - this is the preferred, but I've no clue how
to get started with it.
any help would be greatly appreciated.
Kevin
the page comes from a database. This page includes a registration form
which asks for address information, including the Country.
I have 6 .txt files that contain a complete list of countries that we
sell to (65 in total), each written in the appropriate way for the
language of the site, e.g. Mexico for English US and UK sites and México
for the Spanish language site.
I want to add these countries to a ListBox, changing the .Text of the
ListItem depending on which language the pages is being viewed it.
The problem I think I'll face is that I will have to manually specify 65
ListItem tags and then dynamically set the .Value and .Text for each
one, and that's a lot of work (but if it has to be done, so be it).
I'm wondering if there might be a way to dynamically add new ListItem
tags to my ListBox by opening the .txt file and going through it line by
line until I reach the end.
I have 3 ways/ideas in mind, and wanted to get feedback on them, and
potentially any help/examples of other ways:
1) manually code 65 ListItem tags, 65 "CountryItem45.Value =
txtFileValueEntry;" lines and 65 "CountryItem23.Text =
txtFileTextEntry;" lines;
2) use HTML <select> and <option> tags instead (can I use HTML form tags
inside my ASP.NET runat=server form that uses asp:TextBox tags already,
i.e. mix between .NET and HTML in the same form?)
3) open the .txt file and for each line read create a new ListItem and
set it's .Value and .Text - this is the preferred, but I've no clue how
to get started with it.
any help would be greatly appreciated.
Kevin