How to use in @ Html.CheckBox?

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 not use the st variable in the second method parameter ... I have already tried st, @st, @{st;} and nothing. How can I use the variable to change the code as little as possible?

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

    
asked by anonymous 27.11.2015 / 16:42

1 answer

1

Changing as little as possible, you only have to play the game down. Does that suit you?

And welcome to StackOverFlow:)

    
27.11.2015 / 16:45