Page view counter

Different Data depending to the chosen Language

Last post 06-12-2008 5:11 AM by HosamKamel. 1 replies.

Sort Posts:

  • Different Data depending to the chosen Language

    06-12-2008, 2:40 AM
    • Loading...
    • caspar.net
    • Joined on 04-19-2008, 9:57 AM
    • Posts 26
    • Points 6

     Hallo again,

    Is there any possibilty to get different Data from a DB depending to the chosen Language?

    I build a website with different languages (Language switch in masterPage via cultureInfo) every thing works fine with my Resourcefiles:

    <asp:Label ID="Label4" runat="server" Text="<%$ Resources:Resource, price %>"></asp:Label>
    Now I have a Database with sources in different languages:
    Text_english
    Text_german
    Text_frensh
    <asp:Label ID="Label2" runat="server" Text='<%# Eval("Text_english") %>'></asp:Label>
    How can I change the data "Text_english" to "Text_german" depending to the chosen language on the masterPage? 
     
    caspar.net
    cologne, germany, EU 
      
  • Re: Different Data depending to the chosen Language

    06-12-2008, 5:11 AM
    • Loading...
    • HosamKamel
    • Joined on 01-19-2006, 1:49 PM
    • Egypt
    • Posts 1,291
    • Points 8,873

    Why not store such values in the resource file and take the benefit  of localization in asp.net 2.0 which will modify the text depend in your language .

    if not , you have to either include this language check in the query that retrieve the data OR check for it before binding i this data already retrieved

    Hosam Kamel

    Remember to click on Mark as answer on the post that helped you
Page 1 of 1 (2 items)