2011-02-15 9 views

Respuesta

6

Invertir el caso:

<p>html that I always want</p> 
@if (Model != null) 
{ 
     your html when model != null 
} 
10

No, no return en una vista, simplemente no ofrecen este tipo parcial en la vista principal:

@if (Model != null) { 
    @Html.Partial("somePartial", Model) 
} 

o si usa RenderPartial:

@if (Model != null) { 
    @{Html.RenderPartial("somePartial", Model);} 
} 
Cuestiones relacionadas