Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

How to set label to the checkbox, I looked at some sites they r using lambda expressions, but I cant understand, I am new to mvc

@{
   bool chkVal = false;  
 }
<li>@Html.CheckBox("chksumma",chkVal,new {@value = "5"})</li>
<li>@Html.LabelFor(, "");
share|improve this question
 
 
I'll explain it to you if you post the code for your Model here. –  ataravati Jul 13 at 2:09

1 Answer

I think this will help you:

@HtmlCheckboxFor(f => f.prop) 
<label for="mycheck">@Html.LabelFor(f=>f.prop) </label>

I found it here: http://forums.asp.net/t/1812284.aspx/1

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.