I have a page in html format and I want to change that into the razor syntax. Here is the code:
<label class="class1" for="textinput">
<button class="class2" href="#abc">Send</button> To
</label>
I have a page in html format and I want to change that into the razor syntax. Here is the code:
<label class="class1" for="textinput">
<button class="class2" href="#abc">Send</button> To
</label>
Simply use Razor HtmlHelpers:
@Html.LableFor(model => model.textinput)
//or @Html.Lable("textinput")
<button class="class2" <--!href="#abc"-->>Send</button> To
//we don't have 'href' attribute in button tag
@html.ActionLink("Action", "Controller", null/*routing values*/)
do you wanna have a Button
inside Label
? To understand more read this.
Edit:
According to W3, The label itself may be positioned before, after or around the associated control. See Should I put input tag inside label tag? and Should we put inside ? for more understanding. But, If you really wanna do that, You cant use @Html.Label
or @Html.LabelFor
, because of non potentiality of putting element inside it via Razor Syntax.