asp.net-mvc-views

Minify HTML output from an ASP.Net MVC Application

This is likely a duplicate of the below question but the only answer is a dead link: http://stackoverflow.com/questions/255008/minify-html-output-of-asp-net-application When working with ASP.Net one of the more annoying aspects to me is the fact that Visual Studio puts spaces instead of tabs for white spacing which increases the size of...

what exactly is strongly typed View data in Asp.Net MVC

What is meant by "strongly typed view data" in Asp.Net MVC ? Thanks ...

Adding a view - View data class missing (Asp.net mvc)

When I'm going to create a view and go <methodInController> - right click, add view and get the dialog showing me the options, I WAS getting my viewmodels in there but now those are missing and I'm getting a bunch of this junk ... <PrivateImplementationDetails>+$$struct0x600018b-142 I am using resharper, but I'm not sure if that has a...

How to html encode the output of an MVC view?

I am building a web app which will generate lots of different code templates (HTML tables, XML documents, SQL scripts) that I want to render on screen as encoded HTML so that people can copy and paste those templates. I would like to be able to use asp.net mvc views to generate the code for these templates (rather than, say, using a Str...

Need Help on a custom HTML Helper

I'm trying to create a custom HTML Helper to help simplify my masterpages menu, however it is not rendering on the HTML when I use it.. I'm thinking I will need to create a partial view, any ideas? I did this.. public static string CreateAdminMenuLink(this HtmlHelper helper, string caption, string link) { var lnk = TagBu...

How to Put Javascript into an ASP.NET MVC View

I'm really new to ASP.NET MVC, and I'm trying to integrate some Javascript into a website I'm making as a test of this technology. My question is this: how can I insert Javascript code into a View? Let's say that I start out with the default ASP.NET MVC template. In terms of Views, this creates a Master page, a "Home" View, and an "Abo...

ASP.NET MVC 2 Model with array/list

Hello i'm in the process of creating my first site in ASP.NET MVC, it is a kind of learn as you go. But i have hit a problem that i just can't find a solution for. I want my user to be able to create an album with songs and tags attached. That can be an unspecified number of songs and tags. But there must be a minimum of 5 songs and 2 t...

Why do ASP.NET MVC3 Areas and Razor Views produce this error?

The view at '~/Areas/SomeArea/Views/List/Index.cshtml' must derive from ViewPage, ViewPage, ViewUserControl, or ViewUserControl. The project structure is pretty much default. There is one area called SomeArea. It has a single controller called List. It does nothing except: public ActionResult Index() { return View("~/Areas/SomeArea/...

Bind a list with nested list

Hi, i've got this code Model public class PdfPage { public IEnumerable<PdfPhoto> Photos { get; set; } } public class PdfPhoto { public string path { get; set; } } View <ul> <li> <%= Html.Hidden("ListPages[0].Photos[0].path", "/public/pdfMaker/4_e.jpg")%> <%= Html.Hidden("ListPages[0].Photos[1].path", "/public/pdfMaker...

How do I put a strongly-typed-view WebForms .aspx template in a nonstandard location in ASP.NET MVC2?

So, I personally think this is sort of whack. I put a .aspx template in a nonstandard location. In this example, it has a virtual path of ~/Content/Sites/magical/Index.aspx. I then created my own view engine as a test, which extends WebFormsViewEngine: public class MagicalWebFormsViewEngine : WebFormViewEngine { public override ...