I have an inline style I want to apply to a partial view based on a parameter passed in to it via the ViewDataDictionary.
My ascx look like this -
<div <% if ((bool)ViewData["Visible"] == false) { %> style="display:none;" <% } %>>
...
</div>
Is there a cleaner way to do this?
Edit:
Just to clarify, this is a partial view which is already using strongly typed model. So, I needed a way of passing extra information to the partial view which I couldn't have in the model because it was actually being called for each entry of a collection container in the model for my containing view.