原生html 多选投票

<%@ WebHandler Language="C#" Class="checkHandler" %>

using System;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

public class checkHandler : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        try
        {
            context.Response.ContentType = "text/plain";
            string s = context.Request["c"];
            string[] ids = s.Split(',');
            int j = 0;
            foreach (string str in ids)
            {
                j = Convert.ToInt32(str);
            }            
            string sql = "update people set Num=Num+1 where peopleId=" + j;
            int i= SQLHelper.NonExQuery(sql);
            if (i == 1)
            {
                context.Response.Write("上传成功");
            }
        }
        catch(Exception ex)
        {
            context.Response.Write(ex.Message);
        }


    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}
原文地址:https://www.cnblogs.com/zhang1997/p/8573627.html