好了,现在万事俱备,只欠东风了,让我们看看现在做一个舆论调查多么简单:
file : vote.a x
<%@ Page language="c#" Codebehind="vote.c quot; AutoEventWireup="false" Inherits="Football.vote" %>
<html>
lt;head>
lt;title>532.com.cn --- 舆论调查 ---</title>
lt;link rel=" tylesheet" href=" tyle/style.c quot; type="text/c quot gt;
lt;/head>
lt ody>
lt;form method=" ost" runat=" erver" gt;
lt;table width=400 height=300 align=center>
lt;tr>
lt;td cla =cn valign=top align=center> lt gt;调查题目:
lt;a :label id="lblSurveyTitle" runat=Server cla =c gt lt;/a :label>
lt;/td>
lt;/tr>
lt;tr>
lt;td alin=center>
lt;a :image id="imgSurvey" runat=Server> lt;/a :image>
lt;/td>
lt;/tr>
lt;tr>
lt;td align=center>
lt;i ut type=button onclick="window.close() quot; value="关闭此窗口" gt;
lt;/td>
lt;/tr>
lt;/table>
lt;/form>
lt;/body>
</html>
file: vote.cs
name ace Football
{
using System;
using System.Collectio
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.We
using System.Web.Se io tate;
using System.Web.UI;
using System.Web.UI.WebControl
using System.Web.UI.HtmlControl
/// < ummary>
/// ummary description for vote.
/// </summary>
ublic cla vote : System.Web.UI.Page
#123;
rotected System.Web.UI.WebControls.Image imgSurvey;
rotected System.Web.UI.WebControls.Label lblSurveyTitle;
rivate string m_strSurveyID ;
rivate int m_intVoteID ;
ublic vote()
#123;
age.Init += new System.EventHandler(Page_Init);
#125;
rotected void Page_Load(object sender, EventArgs e)
#123;
if (!I ostBack)
#123;
//
// Evals true first time browser hits the page
//
#125;
#125;
rotected void Page_Init(object sender, EventArgs e)
#123;
//
// CODEGEN: This call is required by the A + Windows Form Designer.
//
InitializeComponent();
Init() ;
#125;
/// < ummary>
/// Required method for Designer su ort - do not modify
/// the contents of this method with the code editor.
/// </summary>
rivate void InitializeComponent()
#123;
this.Load += new System.EventHandler (this.Page_Load);
#125;
rivate void Init()
#123;
m_strSurveyID = Request[" urveyid"].ToString() ;
FootballSurvey mySurvey = new FootballSurvey() ;
try
#123;
m_intVoteID = Request["vote"].ToInt32() ;
mySurvey.LoadFromDatabase(m_strSurveyID) ;
lblSurveyTitle.Text = mySurvey.Title ;
if (m_intVoteID < mySurvey.Items.Count)
#123;
mySurvey.Vote(m_intVoteID) ;
#125;
mySurvey.CreateResultImage(Server.Ma ath(" urvey.jpg") ,


