how i can write razor if else in razor section?
i want to write this code in section i define in
i开发者_C百科f(ViewBag.Resetpass){
<meta http-equiv="refresh" content="3;url=/">
}
in
@section mysection{
}
@section mysection {
@if((bool)ViewBag.Resetpass)
{
<meta http-equiv="refresh" content="3; url=/" />
}
}
which if you use strongly typed view models (which IMHO you should) could look like this:
@section mysection {
@if(Model.Resetpass)
{
<meta http-equiv="refresh" content="3; url=/" />
}
}
精彩评论