1

I want to set the visibility of a checkbox to false without using style in mvc3.

@Html.CheckBoxFor(model => Model.Eng, new { @id = "chkEnergy1", @value = "true", @class = "chkEnergy",@visible=false }).I have given like this but its not working
2
  • 1
    Do you mean you don't want to output the checkbox at all or you don't want to use an external CSS? Commented May 19, 2013 at 12:58
  • Could you instead use @Html.HiddenFor? Commented May 19, 2013 at 13:38

1 Answer 1

1
@Html.CheckBoxFor(model => Model.Eng, new { @id = "chkEnergy1", @value = "true", @class = "chkEnergy",@style = "display:none;" }).
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.