⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 viewvote.aspx

📁 简单投票系统,投票的数据保存在Sql数据库中
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ViewVote.aspx.cs" Inherits="ViewVote" %>

<!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>
        <table>
            <tr>
                <td style="width: 140px">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
                        Width="538px" OnRowDataBound="GridView1_RowDataBound">
                        <Columns>
                            <asp:BoundField DataField="ItemName" HeaderText="投票项目" SortExpression="ItemName" />
                            <asp:BoundField DataField="ItemCount" HeaderText="票数" SortExpression="ItemCount" />
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Image ID="Image1" runat="server" BackColor="Navy" Height="4px" ImageUrl="~/vote.bmp"
                                       Width='<%#FormatVoteImage(FormatVoteCount(DataBinder.Eval(Container.DataItem,"ItemCount").ToString()))%>' />
                                <%# FormatVoteCount(DataBinder.Eval(Container.DataItem, "ItemCount").ToString())%>%
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:VoteConnectionString %>"
                        SelectCommand="SELECT [ItemName], [ItemID], [ItemCount] FROM [VoteItem]"></asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td style="width: 140px">
                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                    &nbsp; &nbsp; &nbsp;&nbsp;
                    <asp:Button ID="Button1" runat="server" Text="转到投票界面" Width="327px" OnClick="Button1_Click" /></td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -