日期:2014-05-18 浏览次数:20493 次
public partial class Default2 : System.Web.UI.Page
{
public string a, b, c, d;
public string AB(string a, string b, string c, string d)
{
return a + b + c + d;
}
//共用的回调事件
public void CheckBox_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox1.Checked == true)
a = "A";
else
a = "";
if (CheckBox2.Checked == true)
b = "B";
else
b = "";
if (CheckBox3.Checked == true)
c = "C";
else
c = "";
if (CheckBox4.Checked == true)
d = "D";
else
d = "";
AB(a, b, c, d);
}
}
------解决方案--------------------
我写个具体的,你懂的
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm27.aspx.cs" Inherits="jquerytest.WebForm27" %>
<!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>
<script src="jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="checkbox" name="newsletter" checked="checked" value="A" /> 篮球
<input type="checkbox" name="newsletter" value="B" /> 足球
<input type="checkbox" name="newsletter" checked="checked" value="C" /> 羽毛球
<input ty