最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

在asp.net網(wǎng)頁中顯示數(shù)學(xué)符號(hào)的代碼

 更新時(shí)間:2012年10月15日 22:56:16   作者:  
在網(wǎng)頁中顯示一些符號(hào),如數(shù)學(xué)符號(hào)(Insus.NET僅提供常用符號(hào)),需要的朋友可以參考下
效果圖:

前提條件是你的網(wǎng)頁是支持utf-8,如在web.config設(shè)置如下:
復(fù)制代碼 代碼如下:

<configuration>
<system.web>
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>

.aspx:
復(fù)制代碼 代碼如下:

<%@ 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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<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") %>:&nbsp;<asp:Label ID="Label1" runat="server" Text='<%# Eval("value") %>' ForeColor="Blue"></asp:Label>
</ItemTemplate>
</asp:DataList>
</div>
</form>
</body>
</html>

.aspx.cs:
復(fù)制代碼 代碼如下:

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("總和", "∑");
sym.Add("全等于號(hào)", "≡");
sym.Add("正負(fù)號(hào)", "±");
sym.Add("加號(hào);正號(hào)", "+");
sym.Add("減號(hào);負(fù)號(hào)", "-");
sym.Add("乘號(hào)", "×");
sym.Add("除號(hào)", "÷");
sym.Add("無限大號(hào)", "∞");
sym.Add("因?yàn)?, "∵");
sym.Add("所以", "∴");
sym.Add("垂直于", "⊥");
sym.Add("角", "∠");
sym.Add("圓", "⊙");
sym.Add("平方根", "√");
sym.Add("度", "°");
sym.Add("分", "′");
sym.Add("秒", "″");
sym.Add("百分之…", "%");
sym.Add("攝氏度", "℃");
sym.Add("約等于號(hào)", "≈");
sym.Add("直徑符號(hào)", "Ø");
sym.Add("四分之一符號(hào)", "¼");
sym.Add("二分之一符號(hào)", "½");
sym.Add("四分之三符號(hào)", "¾");
sym.Add("一次方符號(hào)", "¹");
sym.Add("平方符號(hào)", "²");
sym.Add("立方符號(hào)", "³");
return sym;
}
}

相關(guān)文章

最新評(píng)論

达州市| 大姚县| 顺昌县| 新余市| 延边| 长岛县| 当阳市| 晴隆县| 库尔勒市| 林甸县| 丰台区| 普陀区| 灵武市| 筠连县| 新泰市| 永济市| 仁布县| 双牌县| 运城市| 阿鲁科尔沁旗| 巴青县| 浦城县| 涪陵区| 齐齐哈尔市| 江口县| 来安县| 类乌齐县| 辉南县| 平定县| 资源县| 棋牌| 姜堰市| 商丘市| 铁岭县| 耿马| 新干县| 江油市| 丽江市| 木兰县| 庆安县| 乾安县|