Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在asp.net服务器端从html表中获取html控件_Asp.net - Fatal编程技术网

如何在asp.net服务器端从html表中获取html控件

如何在asp.net服务器端从html表中获取html控件,asp.net,Asp.net,有人能告诉我如何在asp.net服务器端从html表中获取html控件吗? 我的代码是这样的 <div> <table runat='server' id="CheckBoxList1"> <tr> <td> <input runat='server' id='CheckBoxList1_1' type='checkbox' name='CheckBoxList

有人能告诉我如何在asp.net服务器端从html表中获取html控件吗? 我的代码是这样的

 <div>
    <table runat='server' id="CheckBoxList1">
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_1' type='checkbox' name='CheckBoxList1$1'
                    value='1' /><label for='CheckBoxList1_1'>1</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_22' type='checkbox' name='CheckBoxList1$22'
                    value='1' /><label for='CheckBoxList1_22'>22</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_43' type='checkbox' name='CheckBoxList1$43'
                    value='1' /><label for='CheckBoxList1_43'>43</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_2' type='checkbox' name='CheckBoxList1$2'
                    value='1' /><label for='CheckBoxList1_2'>2</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_23' type='checkbox' name='CheckBoxList1$23'
                    value='1' /><label for='CheckBoxList1_23'>23</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_44' type='checkbox' name='CheckBoxList1$44'
                    value='1' /><label for='CheckBoxList1_44'>44</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_3' type='checkbox' name='CheckBoxList1$3'
                    value='1' /><label for='CheckBoxList1_3'>3</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_24' type='checkbox' name='CheckBoxList1$24'
                    value='1' /><label for='CheckBoxList1_24'>24</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_45' type='checkbox' name='CheckBoxList1$45'
                    value='1' /><label for='CheckBoxList1_45'>45</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_4' type='checkbox' name='CheckBoxList1$4'
                    value='1' /><label for='CheckBoxList1_4'>4</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_25' type='checkbox' name='CheckBoxList1$25'
                    value='1' /><label for='CheckBoxList1_25'>25</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_46' type='checkbox' name='CheckBoxList1$46'
                    value='1' /><label for='CheckBoxList1_46'>46</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_5' type='checkbox' name='CheckBoxList1$5'
                    value='1' /><label for='CheckBoxList1_5'>5</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_26' type='checkbox' name='CheckBoxList1$26'
                    value='1' /><label for='CheckBoxList1_26'>26</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_47' type='checkbox' name='CheckBoxList1$47'
                    value='1' /><label for='CheckBoxList1_47'>47</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_6' type='checkbox' name='CheckBoxList1$6'
                    value='1' /><label for='CheckBoxList1_6'>6</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_27' type='checkbox' name='CheckBoxList1$27'
                    value='1' /><label for='CheckBoxList1_27'>27</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_48' type='checkbox' name='CheckBoxList1$48'
                    value='1' /><label for='CheckBoxList1_48'>48</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_7' type='checkbox' name='CheckBoxList1$7'
                    value='1' /><label for='CheckBoxList1_7'>7</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_28' type='checkbox' name='CheckBoxList1$28'
                    value='1' /><label for='CheckBoxList1_28'>28</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_49' type='checkbox' name='CheckBoxList1$49'
                    value='1' /><label for='CheckBoxList1_49'>49</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_8' type='checkbox' name='CheckBoxList1$8'
                    value='1' /><label for='CheckBoxList1_8'>8</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_29' type='checkbox' name='CheckBoxList1$29'
                    value='1' /><label for='CheckBoxList1_29'>29</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_50' type='checkbox' name='CheckBoxList1$50'
                    value='1' /><label for='CheckBoxList1_50'>50</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_9' type='checkbox' name='CheckBoxList1$9'
                    value='1' /><label for='CheckBoxList1_9'>9</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_30' type='checkbox' name='CheckBoxList1$30'
                    value='1' /><label for='CheckBoxList1_30'>30</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_51' type='checkbox' name='CheckBoxList1$51'
                    value='1' /><label for='CheckBoxList1_51'>51</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_10' type='checkbox' name='CheckBoxList1$10'
                    value='1' /><label for='CheckBoxList1_10'>10</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_31' type='checkbox' name='CheckBoxList1$31'
                    value='1' /><label for='CheckBoxList1_31'>31</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_52' type='checkbox' name='CheckBoxList1$52'
                    value='1' /><label for='CheckBoxList1_52'>52</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_11' type='checkbox' name='CheckBoxList1$11'
                    value='1' /><label for='CheckBoxList1_11'>11</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_32' type='checkbox' name='CheckBoxList1$32'
                    value='1' /><label for='CheckBoxList1_32'>32</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_53' type='checkbox' name='CheckBoxList1$53'
                    value='1' /><label for='CheckBoxList1_53'>53</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_12' type='checkbox' name='CheckBoxList1$12'
                    value='1' /><label for='CheckBoxList1_12'>12</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_33' type='checkbox' name='CheckBoxList1$33'
                    value='1' /><label for='CheckBoxList1_33'>33</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_54' type='checkbox' name='CheckBoxList1$54'
                    value='1' /><label for='CheckBoxList1_54'>54</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_13' type='checkbox' name='CheckBoxList1$13'
                    value='1' /><label for='CheckBoxList1_13'>13</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_34' type='checkbox' name='CheckBoxList1$34'
                    value='1' /><label for='CheckBoxList1_34'>34</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_55' type='checkbox' name='CheckBoxList1$55'
                    value='1' /><label for='CheckBoxList1_55'>55</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_14' type='checkbox' name='CheckBoxList1$14'
                    value='1' /><label for='CheckBoxList1_14'>14</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_35' type='checkbox' name='CheckBoxList1$35'
                    value='1' /><label for='CheckBoxList1_35'>35</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_56' type='checkbox' name='CheckBoxList1$56'
                    value='1' /><label for='CheckBoxList1_56'>56</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_15' type='checkbox' name='CheckBoxList1$15'
                    value='1' /><label for='CheckBoxList1_15'>15</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_36' type='checkbox' name='CheckBoxList1$36'
                    value='1' /><label for='CheckBoxList1_36'>36</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_57' type='checkbox' name='CheckBoxList1$57'
                    value='1' /><label for='CheckBoxList1_57'>57</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_16' type='checkbox' name='CheckBoxList1$16'
                    value='1' /><label for='CheckBoxList1_16'>16</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_37' type='checkbox' name='CheckBoxList1$37'
                    value='1' /><label for='CheckBoxList1_37'>37</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_58' type='checkbox' name='CheckBoxList1$58'
                    value='1' /><label for='CheckBoxList1_58'>58</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_17' type='checkbox' name='CheckBoxList1$17'
                    value='1' /><label for='CheckBoxList1_17'>17</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_38' type='checkbox' name='CheckBoxList1$38'
                    value='1' /><label for='CheckBoxList1_38'>38</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_59' type='checkbox' name='CheckBoxList1$59'
                    value='1' /><label for='CheckBoxList1_59'>59</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_18' type='checkbox' name='CheckBoxList1$18'
                    value='1' /><label for='CheckBoxList1_18'>18</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_39' type='checkbox' name='CheckBoxList1$39'
                    value='1' /><label for='CheckBoxList1_39'>39</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_60' type='checkbox' name='CheckBoxList1$60'
                    value='1' /><label for='CheckBoxList1_60'>60</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_19' type='checkbox' name='CheckBoxList1$19'
                    value='1' /><label for='CheckBoxList1_19'>19</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_40' type='checkbox' name='CheckBoxList1$40'
                    value='1' /><label for='CheckBoxList1_40'>40</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_61' type='checkbox' name='CheckBoxList1$61'
                    value='1' /><label for='CheckBoxList1_61'>61</label>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_20' type='checkbox' name='CheckBoxList1$20'
                    value='1' /><label for='CheckBoxList1_20'>20</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_41' type='checkbox' name='CheckBoxList1$41'
                    value='1' /><label for='CheckBoxList1_41'>41</label>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
                <input runat='server' id='CheckBoxList1_21' type='checkbox' name='CheckBoxList1$21'
                    value='1' /><label for='CheckBoxList1_21'>21</label>
            </td>
            <td>
                <input runat='server' id='CheckBoxList1_42' type='checkbox' name='CheckBoxList1$42'
                    value='1' /><label for='CheckBoxList1_42'>42</label>
            </td>
            <td>
            </td>
        </tr>
    </table>
</div>

1.
22
43
2.
23
44
3.
24
45
4.
25
46
5.
26
47
6.
27
48
7.
28
49
8.
29
50
9
30
51
10
31
52
11
32
53
12
33
54
13
34
55
14
35
56
15
36
57
16
37
58
17
38
59
18
39
60
19
40
61
20
41
21
42
谢谢
Mohak

在html控件中编写runat=“Server”属性,然后您可以在服务器端使用html控件。

ypur问题有点不清楚,但我认为这会有所帮助 例如,要访问gridview中的contorl,我们可以使用它,假设您在gridview中放置一个id为“hfone”的隐藏字段

内部GvRowDataBound事件 var字段=(HiddenField)e.Row.FindControl(“hfone”)


因此,您可以按字段访问值。要获取html控件上的值,您必须使用textbox1.value不要使用textbox1.text。您需要什么控件?您尝试了什么?您似乎没有有效的HTML。这可以解释你的问题。这里不允许再问同样的问题。如果你想引起大家对你的问题的注意,两天后你将被允许提问。您还可以添加其他信息,这可能会使您的问题更容易理解和回答。