mvc

With MVC, do interactions with autonomous peripherals belong in the Model or the Controller?

Using MVC with an observer pattern, if a user action requires polling a device (such as a camera) for data, should the polling be done in the Controller and the result passed off the Model or should a request be sent to the Model and the Model itself performs the polling. This question is my attempt to reconcile everything I am reading ...

How do you handle the output of a dynamically generated form in ASP.NET MVC?

Say you create a form using ASP.NET MVC that has a dynamic number of form elements. For instance, you need a checkbox for each product, and the number of products changes day by day. How would you handle that form data being posted back to the controller? You can't set up parameters on the action method because you don't know how many ...

HttpContext on instances of Controllers are null in ASP.net MVC

This may not be the correct way to use controllers, but I did notice this problem and hadn't figured out a way to correct it. public JsonResult SomeControllerAction() { //The current method has the HttpContext just fine bool currentIsNotNull = (this.HttpContext == null); //which is false //creating a new instance of a...

ASP.NET Model View Presenter project structure

I am just starting a new ASP.NET project and using the MVP pattern. I did consider the MS MVC but it is not released yet and would be a big learning curve for some people on the team, so I opted for MVP now and possibly future projects MVC. Anyway, it seems I will have a single Controller/Presenter class for every webform I have it the ...

Where are ASP.NET MVC docs?

I am very impressed with the ASP.NET MVC stuff--and I've seen the various blogs and am quite anxious to dig in. But where are the docs? I can't find any docs on the System.Web.Mvc namespace, or any of its related namespaces. Google searches limited to msdn.microsoft.com don't turn up anything, nor does just googling. I know there are a...

How to Dynamically add menu items to master page in ASP.NET 3.5 MVC app

I want to dynamically add menuitems to my master page based on membership security login role. From what I've read RenderAction in the master page html could perhaps do this. Since I'm fumbling thru this I am not sure how it would look and how in the controller I check my current role. I am considering creating a table and relating the a...

ASP.NET MVC controller actions that return JSON or partial html

I am trying to create controller actions which will return either JSON or partial html depending upon a parameter. What is the best way to get the result returned to an MVC page asynchronously? ...

Using MVC, how should one handle communcation between Views? Between Models?

Question number three in my quest to properly understand MVC before I implement it: I have two cases in mind: The primary application window needs to launch the preferences window. (One View invoking another View.) The primary Model for an application needs to access a property in the preferences Model. (One Model accessing another Mo...

RE: Using themes with ASP.Net MVC

I have an ASP.NET MVC (Beta 1) website that I'm using themes with. When I start my site (I'm still running using the ASP.Net Development Web Server) the default page gives me this error: Server Error in '/' Application. Using themed css files requires a header control on the page. (e.g. ). Description: An unhandled exception occurred...

Why do I need to work harder to make my Rails application fit into a RESTful architecture?

The Background I started a Rails project recently and decided to use RESTful controllers. I created controllers for my key entities (such as Country) and added index, new, edit, create, show, update, delete. I added my map.resources :country to my routes file and life was good. After development progressed a little, I started to encoun...

Linq DataContext class not accessible in my MVC after I save the dbml

I just downloaded MVC and I am going through a tutorial. Everything goes fine until I try to declare a DataContext object. My dbml is named db.dbml (tried another on named test.dbml) and when I try this: public dbDataContext db = new dbDataContext(); I get: The type or namespace name 'dbDataContext' could not be found ... Am...

Getting the first item out of a For loop

I am writing my own Joomla component (MVC), its based heavily on the newsflash module, because I want to display the latest 5 content items in a sliding tabbed interface, all the hard work is done, but I am having real difficult getting content out of the for loop. Here is the code I have so far default.php <ul id="handles" class="tabs...

How do I succesfully host a asp.net mvc app on shared hosting without resorting to ugly URLs?

Let's assume we're talking about the recently released Beta version. Specifically I'm interested in a step-by-step tutorial or similar, and I'd be thrilled with information addressing how to do so on CrystalTech. ...

patterns for controllers in MVC application

What are your favourite patterns for writing a controller? ...

Deploy asp.net mvc beta to iis 6 causing 404's

I'm struggling to get around the 404 errors from asp.net mvc beta when deploying on IIS 6. I had this working in one of the previews by mapping .mvc in IIS but this no longer works. I've read Omar's post and several others on the web and tried their solutions but no luck so far. The home page opens without a problem on IIS 6 but others ...

Best ASP.NET MVC book?

I'm going to be starting a new project with VS2008/ASP.NET, and I would like to use MVC. What is the best MVC book out there? (Are there any good ones?) Edit: I threw in the asp.net-mvc-2 tag so we could possibly get some updated answers. ...

asp.net mvc post to different views in same form

Hi all, I'm an asp.net MVC newbie - very use to webforms! I have form area in my view. If I click button A I want to submit to /Books/1, but if I click button B I want to submit to /Books/2 How do I go about achieving this with MVC? Thanks in advance Nick ...

using MVC view page + $(document).ready

Hi, I've editing this original question as I think I've narrowed down the problem... I have one view in my site that will not let me put $document.ready within a masterpage contentplaceholder. I've stripped this page to the bare bones and the only thing that is special about it is it has a custom route in global.asax routes.MapRoute(...

Database Driven Front End Controller / Page Management Good or Bad?

I am currently working within a custom framework that uses the database to setup a Page Object which contains the information about Module, View, Controller, etc which is used by a Front Controller to handle routing and the like within an MVC (obviously) pattern. The original reason for handling the pages within the database was because...

Using QSortFilterProxyModel with a tree model

I have a QDirModel whose current directory is set. Then I have a QListView which is supposed to show the files in that directory. This works fine. Now I want to limit the files shown, so it only shows png files (the filename ends with .png). The problem is that using a QSortFilterProxyModel and setting the filter regexp will try to match...