CheckBox 的 Request.Form 后台读取标记方法

前台

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CheckBox.aspx.cs" Inherits="CheckBox" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">

 <title>Jquery复选框练习</title>
 <!-- 引入jQuery,引入你自己的jQuery文件 -->
  
 <script type="text/javascript" src="../../Scripts/jquery-3.4.1.js"></script>
 <script type="text/javascript" src="../Scripts/jquery-3.4.1.js"></script>
  
</head>
<body>


 

    
    <form id="form1" name="form1" method="post" runat ="server">

   <input name="funItem" value="1" checked="checked" type="checkbox" />c#
   <input name="funItem" value="2" type="checkbox" />html
   <input name="funItem" value="3" type="checkbox" />javascript
    
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click1" />





       
      
       <table>   
       


  </table>  

   </form>
                                                                                           
                  

        



</body>
</html>
  



后台

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class CheckBox : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
      

     
     
         
             
                


    }


    

    protected void Button1_Click1(object sender, EventArgs e)
    {
        string argValue = Request.Form["funitem"];
        Response.Write("");


    }
}

你可能感兴趣的:(CheckBox 的 Request.Form 后台读取标记方法)