471,603 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

QueryString

hi,

i'm not sure if this has something to do with c# or ASP.NET but i'd like to
know how to use a querystring. i have a webpage that i can translate but i
dont want to make seperate pages for each language. i want a querystring to
edit the text in the page. is this possible? if so, how?

thanx in advance
--
Look Out!

Helter Skelter
Yellow Submarine
Pepperland

PS. Get Back!
Dec 27 '05 #1
2 2703
Hi Beatle,
i'm not sure if this has something to do with c# or ASP.NET but i'd like
to
know how to use a querystring. i have a webpage that i can translate but i
dont want to make seperate pages for each language. i want a querystring
to
edit the text in the page. is this possible? if so, how?


Say, you wanted to have URLs like this, right?

www.somesite.com/products/?lang=en
www.somesite.com/products/?lang=es

If yes, then you would need a solution that would store the individual
language translations in some kind of a database (it needn't specifically be
a SQL database). Then, on each ASP.NET page, you would have code to check
for this query string, and fetch the correct text from the database based on
the language specified.

That is, you would have static layout for the page and for all languages,
but just the main text (and menus/navigation probably) would change from
language to another. This way, designing and editing the pages would be
easier.

Of course, you could also store the user's language selection in a cookie
and so you could have the same URLs for all languages. But the process of
reading the translated text from the database would still be the same.

Also, you could take advantage of ASP.NET's globalization and localization
features, so that you don't need to code the above all by hand. For example,
start here:

http://samples.gotdotnet.com/quickstart/aspplus/

....and scroll down to see the topic "Localization" on the left and follow
the links.

Hope this helps to get you started.

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
ja***@removethis.dystopia.fi
http://www.saunalahti.fi/janij/
Dec 28 '05 #2
hi,

thanks a lot. i think i have managed it now
--
Look Out!

Helter Skelter
Yellow Submarine
Pepperland

PS. Get Back!
"Jani Järvinen [MVP]" wrote:
Hi Beatle,
i'm not sure if this has something to do with c# or ASP.NET but i'd like
to
know how to use a querystring. i have a webpage that i can translate but i
dont want to make seperate pages for each language. i want a querystring
to
edit the text in the page. is this possible? if so, how?


Say, you wanted to have URLs like this, right?

www.somesite.com/products/?lang=en
www.somesite.com/products/?lang=es

If yes, then you would need a solution that would store the individual
language translations in some kind of a database (it needn't specifically be
a SQL database). Then, on each ASP.NET page, you would have code to check
for this query string, and fetch the correct text from the database based on
the language specified.

That is, you would have static layout for the page and for all languages,
but just the main text (and menus/navigation probably) would change from
language to another. This way, designing and editing the pages would be
easier.

Of course, you could also store the user's language selection in a cookie
and so you could have the same URLs for all languages. But the process of
reading the translated text from the database would still be the same.

Also, you could take advantage of ASP.NET's globalization and localization
features, so that you don't need to code the above all by hand. For example,
start here:

http://samples.gotdotnet.com/quickstart/aspplus/

....and scroll down to see the topic "Localization" on the left and follow
the links.

Hope this helps to get you started.

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
ja***@removethis.dystopia.fi
http://www.saunalahti.fi/janij/

Dec 28 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Arpan | last post: by
2 posts views Thread by Mikael | last post: by
5 posts views Thread by David | last post: by
4 posts views Thread by Raterus | last post: by
12 posts views Thread by Alex | last post: by
3 posts views Thread by Dan Sikorsky | last post: by
4 posts views Thread by =?Utf-8?B?RVcgTmV3Ymll?= | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.