I have a CSS using this code
input[type="text"] {
border: 1px solid #CCCCCC;
border-radius: 5px 5px 5px 5px;
box-shadow: none;
padding: 5px 8px;
}
and the HTML page has the following code to use the CSS
<input id="product-name" type="text" required="required">
I want to use the Razor in the view to render the text box called product-name
How can i do this ?
You could use the
TextBoxhelper:But personally I would recommend you to use a view model:
and then have the controller action populate and pass this view model to the view:
and now your view could be strongly typed to the view model: