1.复选框 checkbox

<label class="checkbox">

  <input type="checkbox" name="c1" value="ck1"/>复选框1

</label>

<label class="checkbox">

  <input type="checkbox" name="c2" value="ck2"/>复选框2

</label>

对应model:

public string c1 {get;set;}

public string c2 {get;set;}

在controller中:

public ActionResult SearchButton (string c1)

{ return View(); } 设置断点就可以查看数据,以下同理

 

2.单选框 radio

<label class="radio">

  <input type="radio" name="r" value="r1"/>单选框1

</label>

<label class="radio">

  <input type="radio" name="r" value="r2"/>单选框2

</label>

对应model:public string r {get;set;}

 

3.文本框 text

<input type="text" name="text1" value=""/>

对应model:public string text1 {get;set;}

 

4.密码框 password

<input type="password" name="password1" value=""/>

对应model:public string password1 {get;set;}

 

5.文本域 textarea

<textarea name="textarea1"></textarea>

对应model:public string textarea1 {get;set;}

 

相关文章:

  • 2022-12-23
  • 2022-02-02
  • 2021-06-02
  • 2021-08-28
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
猜你喜欢
  • 2022-01-16
  • 2022-12-23
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
相关资源
相似解决方案