I'm new to MVC. Most of my web programming experience is with ASP.net Web Forms so I have a few old habits to kill before I can start coding in MVC as easily as I did in Web Forms. My question is this:
If I have code such as (taken from example):
<%: Html.TextBoxFor(m => m.UserName) %>
Is there a specific way for me to optionally display this textbox. Normally in WebForms you would simply write
TextBox1.Visible = false;
This code would now only make the TextBox invisible BUT it would also NOT render the HTML. This is key because in my case I have a page (in MVC) that I have information such as List Price, Net Price, Discount and Cost. The cost is only visible to users who have access to viewing cost. Now, my model has access to know if the current user has access or not. How do I pass this on to the view so the textbox is not rendered all together?
View Complete Post