2011-09-16 2 views
0

html 테이블 양식을 얻을 수 있습니다. 어떤 body 내가 asp.net에서 서버 쪽에서 html 테이블을 HTML 양식 컨트롤을 얻을 수 말해 줄 수 있습니까? 내 코드는 이렇게됩니다.어떻게 html 컨트롤을 서버 쪽, asp.net

<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> 

감사 Mohak는

+0

어떤 컨트롤이 필요합니까? 너 뭐 해봤 니? –

+0

유효한 HTML이없는 것 같습니다. 이것은 당신의 문제를 설명 할 수 있습니다. –

+0

동일한 질문을 다시 요청하는 것은 허용되지 않습니다. 질문에주의를 환기시키려는 경우 이틀 후에 [현상금 배치] (http://stackoverflow.com/faq#bounty)가 허용됩니다. 또한 [질문을 편집하십시오] (http://stackoverflow.com/posts/7447583/edit)를 사용하여 추가 정보를 추가하면 질문을 쉽게 이해하고 답변 할 수 있습니다. – Will

답변

0

그런 다음 서버 측 HTML 컨트롤을 사용할 수 있습니다 HTML 컨트롤에 runat = "server"특성 물품.

+0

당신은 textbox1.text를 사용하지 말고 textbox1.value를 사용해야합니다. – haseebkhan

0

ypur 질문이 약간 명확하지 않지만 이것이 도움이 될 것이라고 생각합니다. 예. gridview에서 contorl에 액세스하려면 gridview 내부에 숨겨진 필드를 "hfone"id와 함께 배치하면됩니다.

inside GvRowDataBound 이벤트 var 필드 = (HiddenField) e.Row.FindControl (" hfone ");

필드 값으로 액세스 할 수 있습니다.

관련 문제