多国语言--app_resources..dropdownlist框[englsih,hindi],asp.net 2.0 [英] multi language --app_resources..dropdownlist box [englsih,hindi],asp.net 2.0

查看:64
本文介绍了多国语言--app_resources..dropdownlist框[englsih,hindi],asp.net 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与add_resources合作,但不将所有控制权转让给英语来印地语...
我有三个标签,一个按钮和一个下拉列表..

i m working with add_resources but not to trasfer all control to english to hindi......
i hve three lable one button and one dropdown list..

<table>
            <tr>
                <td colspan="3">
                    <asp:Label ID="Label_main" runat="server" Font-Names="Verdana" Text="Select Language"

                        Width="138px" meta:resourcekey="Label_mainResource1"></asp:Label></td>
            </tr>
            <tr>
                <td style="width: 100px">
                    <asp:Label ID="Label_lan" runat="server" Font-Names="Verdana" Text="Language" meta:resourcekey="Label_lanResource1"></asp:Label></td>
                <td colspan="2" style="width: 187px">
                    <asp:DropDownList ID="DropDownList_lang" runat="server" Width="131px"  AutoPostBack="True">
                    <asp:ListItem>Auto</asp:ListItem>
                    <asp:ListItem meta:resourcekey="ListItemResource1" Text="English" Value="en-US"></asp:ListItem>
                    <asp:ListItem meta:resourcekey="ListItemResource2" Text="Hindi" Value="hi-IN"></asp:ListItem>
                    <%--<asp:ListItem meta:resourcekey="ListItemResource3" Text="Gujarati" Value="gu-IN"></asp:ListItem>--%>
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td style="width: 100px">
                </td>
                <td colspan="2" style="width: 187px">
                    <asp:Button ID="Button1" runat="server" meta:resourcekey="Button1Resource1" Text="Change Language" OnClick="Button1_Click" /></td>
            </tr>
        </table>


我已经尝试将此代码编写


i have try code this

string culture = Request.Form["DropDownList_lang"];
        if (string.IsNullOrEmpty(culture))
            culture = "Auto";
        //Use this
        UICulture = culture;
        Culture = culture;
        //OR This
        if (culture != "Auto")
        {
            System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(culture);
            System.Threading.Thread.CurrentThread.CurrentCulture = ci;
            System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
        }

        base.InitializeCulture();


我的问题是,在下拉列表框中更改语言时不会改变效果,英语会变成印度语
我尝试使调试点,我会得到像文化="HINDI-INDIA"
的结果 但是.我的浏览器端值不会传递给英语到印地语.
我在浏览器中添加了印地文语言...但是问题仍然存在.
请任何人帮助我.


my problem i not change effect when change in language in dropdownlist box ,,,english to hindhi
i try to make debug poin and i will get result like culture ="HINDI-INDIA"
but.my browser side values not pass to english to hindi.
i have add hindi language on my browser ...but problem is still.
please anybody help me.

推荐答案



我意识到我将要放在这里的链接是VB.NET中的一个站点.但是,如果您遵循它,它将向您展示如何执行此操作.

http://vswdtutorialcorner.wordpress. com/2007/09/30/using-localization-in-the-masterpage-vb-sample/

链接一次遍历它.而且我相信,如果您遵循此方法,它应该可以帮助您在网站上放置一种语言选择,以便您选择印地语或英语.

祝你好运

罗布
Hi,

I realise the link I am about to place here is to a site in VB.NET. But if you follow it, it shows you how to do this.

http://vswdtutorialcorner.wordpress.com/2007/09/30/using-localization-in-the-masterpage-vb-sample/

The link goes through it step at a time. And I believe if you follow this, it should help you place a language choice on your site to allow you to select Hindi or English.

Good Luck

Rob


这篇关于多国语言--app_resources..dropdownlist框[englsih,hindi],asp.net 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆