http://community.csdn.net/Expert/topic/2747/2747484.xml?temp=.459469
http://www.codeproject.com/useritems/Generic_Voting_Pole.asp
http://www.aspfree.com/c/a/ASP-Code/ASPNET-Image-poll-generator-using-a-database-and-Codebehind/

解决方案 »

  1.   

    现在这个系统又变为在线打分了.
    我想把候选人姓名列出来,在每个姓名的右边出一个文本框,评委打分后,把每个人打的分数加总到数据库中.该怎样做?
    用DATAGRID的编辑功能,我无法将"得分"一栏设为空(不能让评委看到候选人已得的分数).
      

  2.   

    不要显示出得分列不就行了吗
    如果想要只在编辑状态下不显示的话 参考以下代码
    private void dg1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
    {
    if(e.Item.ItemType==System.Web.UI.WebControls.ListItemType.EditItem)
    {
    DropDownList ddl=(DropDownList)e.Item.FindControl("s_college");
    if(ddl!=null)
    {
    SqlConnection cn=new SqlConnection(Application["Sqlconnstring"].ToString());
    cn.Open();
    SqlCommand cmd=new SqlCommand("select distinct school.college_code,college_name from school join ts_college on(school.college_code=ts_college.college_code)",cn);
    SqlDataReader dr=cmd.ExecuteReader();

    ddl.DataSource=dr;
    ddl.DataValueField="college_code";
    ddl.DataTextField="college_name";
    ddl.DataBind();
    dr.Close();
    cn.Close();
    }

    TextBox tpass=(TextBox)e.Item.FindControl("s_password");
    if(tpass!=null)
    {
    // tpass.Attributes["value"]="asd";
    }
    if(e.Item.Controls[0].Controls[0].GetType().ToString() == "System.Web.UI.WebControls.TextBox")
    {
    TextBox tb = (TextBox)e.Item.Controls[0].Controls[0];
    tb.ForeColor=Color.Red;
    tb.Width = Unit.Parse("70px");
    //tb.Text = Server.HtmlDecode(tb.Text);
    // tb.Text=Server.HtmlDecode(tb.Text);
    }

    }
      

  3.   

    我用ItemTemplate asp:textbox 定义了一个打分框,我怎样把评委的打分和DATAGRID里原来的得分项相加呢?
    我已经开始试着用ItemDataBound方法,但还没成.
    在线等待.