1

Visual StudioPro2010で開発されたasp.netサイトがあります。WindowsServer2008R2とSQLServer2008 R2のバックエンドがあり、II7とFrameworkは4.0です。

私のドロップダウンリストはIEでのみ機能しますが、chromeとfirefoxでは機能しません。アイテムが変な文字で表示されており、出力がエンコードされていると推測しているので、問題を解決するためのコードを実装しただけですが、何か問題があるようです。以下のコードを参照してください。

また、問題が発生した場合に備えてレガシー構成を試してみたので、web.configファイルに次の行を追加することにしました。

web.config

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>

ASP.NET HTML TAG

<asp:DropDownList ID="JobCategoryList" runat="server"  OnDataBound="SortHTML">
    </asp:DropDownList>

コードビハインド

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
        {
            DisplayCategories();
        }  
}

private void DisplayCategories()
    {
        _objCategories.getJobCategories();
        JobCategoryList.DataSource =         _objCategories.JobCategoriesDS.Tables["GetJobCategories"];
        JobCategoryList.DataTextField = "CategoryName";
        JobCategoryList.DataValueField = "Id";
        JobCategoryList.DataBind();
    }

protected void SortHTML(object sender, EventArgs e)
    {
        foreach (ListItem item in ((DropDownList)sender).Items)
        {
            item.Text = Server.HtmlDecode(item.Text);
        }
    }
4

1 に答える 1

0

これはcssの問題です。この/css/normalize.css行を見つけて、フォントファミリを削除し、リストからエーテルを削除selectします。

button,
input,
select,
textarea {
    font-family: inherit; /* 1 */ <--------- remove it
    font-size: 100%; /* 2 */
    margin: 0; /* 3 */
}

base.cssまた、この行からこの有線フォントからも削除します

/* Form defaults */
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select { 
    border: 1px solid #ccc;
    padding: 6px 4px;
    outline: none;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    border-radius: 2px;
    font-family: 'MuseoSans500Regular', Arial, sans-serif; <-------- remove it
    color: #777;
    margin: 0;
    width: 210px;
    max-width: 100%;
    display: block;
    background: #fff;
    -webkit-transition: all 0.2s ease-out;
    -moz-transition: all 0.2s ease-out;
    transition: all 0.2s ease-out;
    -webkit-box-sizing:border-box;
    -moz-box-sizing:border-box;
    box-sizing:border-box;
    }

MuseoSans500Regularあなたはこのフォント名をドロップダウンリストに載せました、そしてこれはフォントのこの有線の悪いデザインになります。

フォントファミリーを変更したり、selectこのcss行から削除したりすることはできますが、これが問題です。

于 2012-12-02T19:08:13.307 に答える