| 搜索频道 | 源码下载 | 站长代码论坛 | 文章分类 | 最新专题 | 源码交易 | 加入收藏
首页|资讯|图形图像|网站开发|程序设计|数据库|多媒体|机械电子|办公系列|路由技术|原理|应用|考试|系统
文章搜索:
 您的位置:首页网站开发ASP.NETAsp.Net基础教程 → 用ASP.NET 2.0设计网络在线投票系统
用ASP.NET 2.0设计网络在线投票系统

日期:2006-8-10 10:10:29 人气:     [ ]
上一页 [1] [2] [3] [4] [5] 下一页
  显示投票结果页面设计

  在应用程序WebVote中添加一个新的Web页面,并命名为ShowVoteInfo.aspx,它的代码隐藏文件为ShowVoteInfo.aspx.cs文件。

  1.页面设计

  在页面ShowVoteInfo.aspx上添加一个数据网格控件、一个Label控件和一个Button控件,它们的名称分别为VoteList、VoteMessage、WebOnlineVoteBtn。控件VoteList用来显示参与投票的项目的投票情况,并计算各个投票项目所占的百分比;控件VoteMessage显示用户投票的总票数;控件WebOnlineVoteBtn实现投票页面WebOnlinVote.aspx。页面ShowVoteInfo.aspx的设计界面如图8所示。



图8 页面ShowVoteInfo.aspx的设计界面

  页面ShowVoteInfo.aspx的HTML设计代码如下:

<%@ Page Language="C#" AutoEventWireup="true"

CodeFile="ShowVoteInfo.aspx.cs" Inherits="ShowVoteInfo" %>

<HTML><HEAD><title>网络在线投票系统</title></HEAD>

<asp:DataGrid ID="VoteList" Runat="server" CssClass="Normal"

AutoGenerateColumns="False" DataKeyField="VoteID">

<HeaderStyle BackColor="Orange"></HeaderStyle>

<Columns>

<asp:TemplateColumn HeaderText="投票项目">

<ItemStyle Width="200px"></ItemStyle>

<ItemTemplate><%# DataBinder.Eval(Container.DataItem,"Item")%>

</ItemTemplate></asp:TemplateColumn>

<asp:TemplateColumn HeaderText="所占总票的百分比">

<ItemStyle Width="300px"></ItemStyle>

<ItemTemplate>

<asp:Image ID="voteImage" Runat="server" Height="20" Width='<%#

FormatVoteImage(FormatVoteCount(DataBinder.Eval(

Container.DataItem,"VoteCount").ToString()))%>'

mageUrl="Images/vote.gif">

</asp:Image>

<%# FormatVoteCount(DataBinder.Eval(Container.DataItem,

"VoteCount").ToString())%>%

</ItemTemplate></asp:TemplateColumn>

<asp:TemplateColumn HeaderText="票数">

<ItemStyle Width="100px"></ItemStyle>

<ItemTemplate>

<asp:Label ID="VoteCount" Runat="server">

<%# DataBinder.Eval(Container.DataItem,"VoteCount")%>

</asp:Label>

</ItemTemplate></asp:TemplateColumn>

</Columns>

</asp:DataGrid>

<asp:Label ID="VoteMessage" Runat="server" ForeColor="Red"

Width="100%"></asp:Label>

<asp:button id="WebOnlineVoteBtn" Runat="server" Width="100"

Text="返回投票页面" CssClass="ButtonCss"

OnClick="WebOnlineVoteBtn_Click"></asp:button>

</HTML>

上一页 [1] [2] [3] [4] [5] 下一页
出处:本站原创 作者:zzcode
 相关软件
·小雅调查投票系统
·宇航通用投票系统 V1.0 TEST版
·长江大学校徽评选投票系统
·长江大学校徽评选投票系统
·心情网络投票系统
·零距离投票系统VoteZ v1.5
·雪晖在线投票系统 2005
·蓝滨投票系统c# v1.0 Beta
·雪晖在线投票系统 v2.3 元旦版
·UO投票系统 v2.1 单项目多投版
 

 热点文章

·用ASP.NET 2.0设计网络..
·AutoPostBack 属性及P..
·ASP.NET 2.0的页面缓存..
·Calendar Web 控件的事..
·ASP.NET 2.0中创建内容..
·ASP.NET2.0数据库入门..
·ListItem Web 控件
·ASP.NET+MySQL:强势组..
·ASP.net简介
·RegularExpressionVal..
·取得客户端浏览器的信..
·ASP.NET2.0 数据绑定函..
·ASP.NET 2.0中XSLT的使..
·ASP.NET环境的安装(1)..
·分页功能

 推荐文章

·端午非物质文化遗产登..
·动态网站Web开发PHP、..
·PS绘中秋佳节的一轮明..
·细谈网页优化和网站优..
·建站常识:如何使用FT..
·如何快速建造一个成功..
·ASP.NET 2.0 中的创建..
·ASP.NET2.0服务器控件..
·在ASP.NET应用中插入f..
·用Photoshop打造逼真立..
·Windows 2003搭建虚拟..
·站长必读:Web创业的1..
·如何测试机房的速度和..
·北京奥运体育图标发布..
·网络视频广告将身价百..