How to use in @Html.Checkbox?

Asked

Viewed 236 times

2

I have the following code:

@{
   var st = //(minha lógica q retorna bool);
}
@Html.CheckBox("MeuNome",st,new { id = "MeuID", value = "MeuValor" })

I can’t use the variable st in the second parameter of the method... I’ve tried st, @st, @{st;} and nothing. How can I use the variable in order to change the code less possible?

The code above is inside a @using(@Html.BeginForm()){

1 answer

1


Changing less possible is just you play the } down... This meets?

And welcome to Stackoverflow :)

  • It worked. Thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.