GridView with bad chars RRS feed

  • Question

  • User-909867351 posted


    I have one gridview with this code:

    <asp:GridView ID="GridView1" CssClass="table table-hover " GridLines="None" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" OnRowCommand="GridView1_RowCommand">
                                            <asp:TemplateField HeaderText="Apagar">
                                                    <asp:ImageButton ID="ImageButton1" CommandName="apagar" CommandArgument='<%#Eval("id")+";"+Eval("nome") %>' runat="server" ImageUrl="~/imagens/delete.png" />
                                            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" SortExpression="id" ItemStyle-CssClass="hiddencol" HeaderStyle-CssClass="hiddencol" />
                                            <asp:BoundField DataField="nome" HeaderText="nome" SortExpression="nome" />
                                            <asp:TemplateField HeaderText="Alterar">
                                                    <asp:ImageButton ID="ImageButton2" CommandName="editar" CommandArgument='<%#Eval("id")+";"+Eval("nome") %>' runat="server" ImageUrl="~/imagens/edit.png" />

    The field nome show chars like that in the grid


    but in mysql file all is ok


    It seems the website does not support portuguese chars. How to solve this issue?

    My sql command 

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="select * from entidades where id<>5"></asp:SqlDataSource>

    Thank you

    Wednesday, August 7, 2019 9:31 PM


  • User288213138 posted

    Hi mariolopes,

    Please check if your operating system, browser application and website support displaying Portuguese language.

    I tested it on my chrome, Firefox, IE and Edge. They all display normally.

    what is the type of encoding or character set you are using for the application?

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Unable to display language problems properly.aspx.cs" Inherits="case_solution.Rendering_issues.Unable_to_display_language_problems_properly" %>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <form id="form1" runat="server">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
                        <asp:BoundField DataField="nome" HeaderText="nome" SortExpression="nome" />
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CaseTestConnectionString %>" SelectCommand="SELECT [nome] FROM [Test33]"></asp:SqlDataSource>

    Here is an article about how to set the display characters in chrome for your reference. https://itstillworks.com/display-japanese-characters-google-chrome-14542.html

    If you haven't solved the problem, please post you aspx code.

    Best regards,

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 8, 2019 5:32 AM