MVC3----Other input helper methods

Source: Internet
Author: User

--------------Html.hidden

@Html. Hidden ("SchoolID", "1")//General auxiliary method

@Html. Hiddenfor (M=>m.schoolid)//strong type helper method

Render markup:

<input id= "SchoolID" name= "SchoolID" type= "hidden" value= "1/" >



--------------Html.password (the committed value is not preserved)

@Html. Password ("UserPassword")//General auxiliary method

@Html. Passwordfor (M=>m.userpassword)//strong type helper method

Render markup:

<input id= "UserPassword" name= "UserPassword" type= "password" value= ""/>



--------------Html.radiobutton (radio button, two sets of selections)

The following example is divided into sex and st_id groups


<br/> Sex://General Auxiliary method

@Html. RadioButton ("Sex", "1", true) male

@Html. RadioButton ("Sex", "2") female

<br/> Color://strong Type helper method

@Html. radiobuttonfor (model = model.st_id, "1") Green

@Html. radiobuttonfor (model = model.st_id, "2") * * *


--------------html.checkbox (check button)

<br/> Color:

@Html. CheckBox ("Color") red

@Html. CheckBox ("Color") Black


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/57/B3/wKiom1SidH_x5jlGAABL3BRV2SU132.jpg "title=" Sogou 20141230174935.png "alt=" Wkiom1sidh_x5jlgaabl3brv2su132.jpg "/>


Technical Learning Group (developing, free resources for group members): 426634651

This article is from the "program Ape's Home--hunter" blog, please be sure to keep this source http://962410314.blog.51cto.com/7563109/1597886

MVC3----Other input helper methods

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.