mvc

ASP.NET MVC Index vs. Index and List views

I'm developing my first ASP.NET MVC application. This application tracks events, users, donors, etc. for a charitable organization. In my events controller I support standard CRUD operations with New/Edit/Show views (delete is done via a button on Show view). But I also want to list all of the events. Is it better to have a List vie...

Is enemy / bot A.I. part of the model or controller in an MVC game

It could be part of the model because it's part of the business logic of the game. It could be part of the controller because it could be seen as simulating player input, which would be considered part of the controller, right? Or would it? What about a normal enemy, like a goomba in Mario? UPDATE: Wow, that's really not the answer I ...

How to use multiple view engines in ASP.NET MVC application

Hi, I'd like to use two view engines in my asp.net mvc web application. The first one is the Brail view engine from MVCContrib project, and another one is my custom view engine for generating javascript code. However, I can't configure the application to use both engines. I'd like to use view file extension to discern which engine should...

In game development, is the controller in MVC purely for dealing with user input?

I've read conflicting things on this. From Wikipedia: Controller Processes and responds to events, typically user actions, and may invoke changes on the model. It's the word TYPICALLY that is confusing. If not just user input, then what else? ...

MVC and cocoa bindings best practices question

Lets say I have a view, myView, a view controller, myViewController, and some sort of model object, myModel. Further, lets say the model has two KVO compliant properties, arrayOfPeopleNames and arrayOfAnimalKinds (both NSStrings). In my view I want to have two pop-ups bound to the contents of these two arrays. My question is, if myCont...

ASP.NET MVC controller unit testing boggle

I've been going through the various tutorials regarding the right way to unit test controller logic. Take the following action: public ActionResult Login() { //Return the index view if we're still here return View(); } Word on the street is to wire up a test method similar to this: [TestMethod] pub...

ASP.NET MVC: Controller ViewData & ViewPage ViewData

Hello, I seem to be unable to find the "link" between a controller's ViewData collection and a ViewPage's ViewData collection. Can anyone point me to where in the MVC framework a controlle's ViewData collection is transferred to a ViewPage's ViewData collection? I have spent quite a lot of time using Reflector to try and work this one ...

Controller inheritance in Cake PHP ???

Has anyone attempted this? Is it possible, and if so, what kind of problems will I run into if I try to accomplish it? ...

ASP.NET MVC Caching vary by controller action parameter

Is there any way I can vary caching by a controller action parameter using the outputcache attribute? We have varybyparam which will not work if my parameters are embedded within the url in a REST manner. Thanks ...

ASP.NET MVC vs WebForms for First Page Load Speed for Big Projects

We have a pretty big ASP.NET WebForm (web application) project with a lot of references to other libraries, other projects etc and most of the time after a compilation, the first time we load a page it takes a LONG time before rendering anything... Disk IO is the main problem. For small projects it's nearly instantaneous, but once your...

ASP.NET MVC - Current Action

I wanted to set a css class in my master page depending on the current controller and action. I can get to the current controller via ViewContext.Controller.GetType().Name, but how do I get the current action? (ie Index, Show etc) ...

Updatemodel error when list item removed

I have an edit page to edit some info. the page fills a complex object. one of the properties of this object is a generic list. If I just edit information and save, updatemodel works fine. if i remove (I do this using jquery to remove the form elements client side) something from the list the updatemodel fails with an "object not set to...

How can I get the route name in controller in ASP.NET MVC?

ASP.NET MVC routes have names when mapped: routes.MapRoute( "Debug", // Route name -- how can I use this later???? "debug/{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = string.Empty } ); Is there a way to get the route name, e.g. "Debug" in the above example? I'd like to access it in the controller's...

How do you submit a dropdownlist in asp.net mvc

<% using (Html.BeginForm() { %> <%=Html.DropDownList("TopItemsList", ViewData["ListData"], new { onchange="[???]" })%> <% } %> In the above example, what value should you set onchange to? Or, how do you get the correct form? Is there any difference with Ajax.BeginFrom? ...

Creating urls with asp.net MVC and RouteUrl

I would like to get the current URL and append an additional parameter to the url (for example ?id=1) I have defined a route: routes.MapRoute( "GigDayListings", // Route name "gig/list/{year}/{month}/{day}", // URL with parameters new { con...

Adapting Linq Entity objects to Domain objects

Hi, I have the following code which adapts linq entities to my Domain objects: return from g in DBContext.Gigs select new DO.Gig { ID = g.ID, Name = g.Name, Description = g.Description, StartDate = g.Date, En...

Notify panel similar to stackoverflow's

Remember the little div that shows up at the top of the page to notify us of things (like new badges)? I would like to implement something like that as well and am looking for some best practices or patterns. My site is an ASP.NET MVC app as well. Ideally the answers would include specifics like "put this in the master page" and "do th...

Would the MSFT Report Viewer (rdlc) Work with MVC

I am interested in learning MVC, and have experimented with a couple of the sample apps. As a project, I'd like to move part or all of my own office app to MVC. An important part of this app, and of ALL of my apps for customers, is the printing of invoices, purchase orders, inventory lists and so forth. In fact, one of their main crite...

How do you submit a dropdownlist in asp.net mvc from an Ajax form

How do you submit from a dropdownlist "onchange" event from inside of an ajax form? From the following question here: http://stackoverflow.com/questions/364505/how-do-you-submit-a-dropdownlist-in-aspnet-mvc, from inside of an Html.BeginFrom you can set onchange="this.form.submit" and changing the dropdown posts back. However, using the...

In a MVC-model, whose responsibility is it to sanitize input?

A simple question: I have a Model-View-Controller setup, with Models accessing a SQL database. In which part should I sanitize/check for malformed incoming data? ...