Effect Chart:
The prerequisite is that your Web page is supported Utf-8, as in the Web.config setting as follows:
Copy Code code as follows:
<configuration>
<system.web>
<globalization fileencoding= "Utf-8" requestencoding= "Utf-8" responseencoding= "Utf-8"/>
</system.web>
</configuration>
. aspx:
Copy Code code as follows:
<%@ Page language= "C #" autoeventwireup= "true" codefile= "ShowSymbol.aspx.cs" inherits= "Showsymbol"%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title></title>
<body>
<form id= "Form1" runat= "Server" >
<div>
<asp:datalist id= "Datalistsymbol" runat= "Server" repeatcolumns= "9" repeatdirection= "Horizontal" Width= "100%" >
<itemstyle borderstyle= "Solid" borderwidth= "1px"/>
<ItemTemplate>
<%# Eval ("key")%>: <asp:label id= "Label1" runat= "Server" text= "<%#" eval ("value")%> ' forecolor= ' Blue ' ></asp:Label>
</ItemTemplate>
</asp:DataList>
</div>
</form>
</body>
. Aspx.cs:
Copy Code code as follows:
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using System.Web.UI;
Using System.Web.UI.WebControls;
public partial class ShowSymbol:System.Web.UI.Page
{
protected void Page_Load (object sender, EventArgs e)
{
if (! IsPostBack)
{
Data_binding ();
}
}
private void Data_binding ()
{
This. Datalistsymbol.datasource = Symbol ();
This. Datalistsymbol.databind ();
}
Private dictionary<string, string> Symbol ()
{
dictionary<string, string> sym = new dictionary<string, string> ();
Sym. ADD ("Sum", "∑");
Sym. ADD ("Full equals number", "Chess");
Sym. ADD ("plus sign", "±");
Sym. ADD ("plus sign; plus", "+");
Sym. ADD ("minus sign; minus sign", "-");
Sym. ADD ("Multiplication", "X");
Sym. ADD ("division", "a");
Sym. ADD ("Infinite Size", "∞");
Sym. ADD ("because", "∵");
Sym. ADD ("So", "∴");
Sym. ADD ("perpendicular to", "⊥");
Sym. ADD ("angle", "∠");
Sym. ADD ("Round", "⊙");
Sym. Add ("Square root", "√");
Sym. ADD ("degree", "°");
Sym. Add ("Min", "′");
Sym. Add ("Seconds", "″");
Sym. ADD ("percent ...", "%");
Sym. ADD ("Celsius", "℃");
Sym. Add ("About equals number", "≈");
Sym. ADD ("diameter symbol", "Ø");
Sym. ADD ("One-fourth symbols", "¼");
Sym. ADD ("One-second symbols", "½");
Sym. ADD ("Three-fourths symbols", "¾");
Sym. ADD ("square symbol", "¹");
Sym. ADD ("square symbol", "²");
Sym. ADD ("cubic symbol", "³");
return sym;
}
}