asp.net-mvc

Finding the right pattern for loading objects with different graphs

I'm trying to figure out the best way to handle loading objects with different graphs (related entities) depending on the context their being used. For example Here's a sample of my domain objects: public class Puzzle { public Id{ get; private set; } public string TopicUrl { get; set; } public string EndTopic { get; set; } ...

ASP.NET MVC Custom Type List in Partial View

I have a view that takes a PaginatedList (like in Nerd Dinner sample). The page works as intended. Now I have added a partial view that takes the same PaginatedList and I call RnederPartial inside the first view. ASP.NET throws a exception that I can't seem to resolve. PaginatedList Code: public class PaginatedList<T> : List<T> { p...

Downloading a file onto client in ASP.NET MVC application using JQuery

Hi, I have a ASP.NET MVC controller with a method which needs to serve up a file to the client(browser). The controller action is invoked with a JQuery $.ajax call. The user needs to be prompted to download the file once the controller action has finished. I used Response.Transmitfile/Response.WriteFile in the controller method but both...

Why does vs.net 2008 web deployment project create unwanted files

Does anyone know why when I compile my web deployment project it creates a vs.net project file and a bunch of other unwanted/unneed files in the release and debug folders. The debug files are also being included even though I have the "Generate debug information" option unchecked when in release mode. I'm also getting some obj folder th...

jquery flexigrid set active row

Hi! How do I set a active row in jQuery Flexigrid after reloading it (after a ajax callback)? Thanks in advance! ...

Should I create a ADO.NET Entity Data Model for each table, or one for my entire database?

Hi, Are you supposed to use one ADO.NET Entity Data Model for each table? Or one for your entire database where relationships are also routed, etc... ...

Linq to SQL MVC issue with FK

right having a bit of a hard mental blog with some Linq to SQL and MVC. Getting the basic MVC and L2SQL going ok. FK relationships. -> when using MVC and we have a fk relationship in the model, and the view is based on a strongly typed object - how do you get the data from the related table? So for example User (Table) UserId Use...

A custom ActionResult for a multi-part http response?

I'd like to respond to an http request with both a txt file and an html page. This way the client can save the file and see a summary of that file's contents via an html page. Since the file is generated on the fly, I have to use state management on the server to generate the summary on the second request. I'd like to avoid this and wra...

Entity validation with different scenario

On the assumption that I have Entity with couple of fields. Some fields are required at some specific state but others only on further/other state. public class Entity { //Required always public SomeReference {} //Required in specific situation/scenario public OtherReference {} } How to achieve that scenario with som...

How do I debug ASP.NET compilation errors?

I have a large, complicated web site, mostly written by other people. I've made some changes, and now when I try to access any page on the site (not just where my changes are), I get the error described below. While I'd like to know how to fix this problem, I'd even more like to know the general diagnostic steps I should take next in o...

Can you convert an ASP.NET MVC Application to a Web Site using ASP.NET MVC and what problems might you run into?

I would like to use a WebSite project instead of a Web Application project for an MVC project. What is the best way to accomplish this and are there signifigant problems that I might run into? (as a side note, my reasoning for wanting this is because I have graphic designers who put files into SVN but they don't get added to the "proje...

Generating RSS with ASP.Net MVC?

How would you generate RSS using ASP.Net MVC? I have the data in the database already and I'll transform it as necessary. My first approach is to create an RSS template that I use as a view, but that seems error prone and since RSS is a structured format there could be a class that I set some properties and generates RSS. Is there such a...

Why asp:ContentPlaceHolder on the title replaces the whole title?

Using ASP.Net MVC on my Site.Master I have: <head runat="server"> <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /> - MySite</title> <link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> </head> then on each view I have something like: <asp:Content ID="Title" ContentPlaceHolderID="TitleConte...

Httpwebreqest works with Fiddler On otherwise Timeout

Hi Guys, I am getting a weird error. I have setup a script that works perfectively when Fiddler is open - it downloads a report from a website using httpwebrequest and everything works fine! HOWEVER it only works when Fiddler is open ? When fiddler isnt working I just get a "Request Timeout Issue" Does anyone know how to fix this and ...

ViewData not inheriting in partials

Hi, I was trying to use a shared partial view to render when a particular listing page has no data. I wanted to use ViewData to pass information from the page into my listing control, which would then conditionally render the NoData partial view using the ViewData values. I would like to be able to specify them in the view markup, ...

How to avoid 'null' strings when binding JSON data on client side

Is it possible to avoid having 'NULL' stings on the client when binding JSON data to HTML UI? I'm using ASP.NET MVC + jQuery + jTemplates. Data is coming from linq-to-sql classes and these classes have quite a lot of nullable properties. When such properties get serialized and transferred back to client I end up with such JSON: [{"Id":...

Sharing a master between MVC and WebForms - dealing with the <form>

We have a large legacy application where we want to start using MVC for new functionality. To do this we added custom routing, for instance: routes.IgnoreRoute( "{*allaspx}", new { allaspx = @".*\.as[pmh]x(/.*)?" } ); And we want to share the master page between the old WebForms and the new MVC pages. This seems simple enough - chan...

ASP.NET MVC - Model binding a set of dynamically generated checkboxes - how to

Hi, I'm trying to model bind a set of dynamically generated checkboxes so as to process them in the controller action but can't get the model binding to occur. This is the scenario: My ViewModel class (DocumentAddEditModel) contains a dictionary (Dictionary<string,bool>) with the string of each entry being the name/label for each check...

Using Html.BeginForm to post to the current controller

I have a partial that is used in several views. The partial contains forms. The action when a form is submited is allways the same, but the controller thats contains the action depends on the view. Lets say I have Controllers that each have an action ActOnChoosenPerson: FireStaffController HireStaffController I have a partia...

ASP.NET MVC - Model Interfaces

Seeing as though I've now solved all of my LINQ problems I'm not working on developing an actual model. The thing is with this is that I do not want to be tied in to a single technology, I want to have freedom to implement different data access technologies and work to a single interface. Now, I've never done this before, but based on ...