mvc

Asp.net MVC Partial View Form Submit Problem

How do i return a partial view inside a master page after submitting a form. Basically what i'm trying to do is display form validation errors, but the problem i can only manage to return a partial view not the master page or full view that its in. Any suggestions? ...

Can't create HtmlHelper methods in VB MVC app

I can't figure out what I'm missing in the following code. I've got a method that should add a (dummy) helper extension: Imports System.Runtime.CompilerServices Namespace HtmlHelpers Public Module HelpExtensions <Extension()> _ Public Function HelpMe(ByVal HtmlHelper As HtmlHelper) As String Return "<a...

Http verb decorator for Django?

In ASP.NET MVC, you can use the AcceptVerbs attribute to correlate a view function with a verb: public ActionResult Create() { // do get stuff } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(FormCollection collection) { // do post stuff } The Django Book suggests something like this: def method_splitter(request, ...

What makes a framework a "true" MVC framework?

When reading online discussions about MVC frameworks, I hear a lot of commentary pointed toward PHP projects like Cake, Code Igniter and Symfony from Java/.NET developers in the vein of "those are clever hacks, but not true MVC". So, what makes something a "true" MVC framework. i.e. what's an example of a .NET or Java MVC framework th...

What goes into the "Controller" in "MVC"?

I think I understand the basic concepts of MVC - the Model contains the data and behaviour of the application, the View is responsible for displaying it to the user and the Controller deals with user input. What I'm uncertain about is exactly what goes in the Controller. Lets say for example I have a fairly simple application (I'm speci...

Does the DataMapper pattern break MVC?

I have been reading up on multiple PHP frameworks, especially the Zend Framework but I am getting confused about the proper way to go forward. Zend Framework does not use ActiveRecords but instead uses the Table Data Gateway and Row Data Gateway pattern, and uses a DataMapper to map the contents of the Row Data Gateway to the model, bec...

Proper Design of a MVC Project

I've been using Kohana for a couple months now, and am still relatively new to the MVC style of organizing your code/presentation/db-layer. Unfortunately, while there is plenty of documentation on how to create a controller, establish a view, and interact with a db via a model, I've not found many resources that deal with clean, and sugg...

model view controler in grails with out database backend?

I don't have any experience with MVC, and am trying to use Grails to write a simple web app. All the examples I've found assume you have a database to base your domain classes off of, and there for have a model based on a database. I'm getting data through an API that does socket communication, and would want the model to be based on tha...

How can I mock Elmah's ErrorSignal routine?

We're using ELMAH for handling errors in our ASP.Net MVC c# application and in our caught exceptions, we're doing something like this: ErrorSignal.FromCurrentContext().Raise(exception); but when I try to unit test the caught exceptions, I get this message: System.ArgumentNullException: Value cannot be null. Parameter name: context H...

Entity framework primary keys in Views

I have to use a View with the EF but, when e import it, the primary key of the view is displayed incorrectly and for some reason I can't change it. ...

Implementing IDataErrorInfo with SubSonic 2.2

Hi, I am moving 1 project, just the data tier, the project is using MVC 1.0 and acess mdb :S Now I am moving to SubSonic + Sql server and all is fine, except when I try to implement to my class IDataErrorInfo for validation messages, I get always 2 times every error message I have a table class generated by subsonic:MyTable, then I ext...

how does cairngorm+flex integrate with rails?

I mean, the mvc for cairngorm and the one in rails don't overlap their functionalities? I'm not sure I understand the need for cairngorm with the rails backend.. ...

Should a model itself do some calculation?

Hi, I have been learning ASP.NET MVC for few months. I have learned about view, controllers and models and stuff. To design a view we always need a model, Usually a model is a just a class which we fill with data and pass to a view. I have a question here should model itself do some calculation or it should be just dumb. For example...

asp.net mvc complex routing for tree path

I am wondering how can I define a routing map like this: {TreePath}/{Action}{Id} TreeMap is dynamically loaded from a database like this: 'Gallery/GalleryA/SubGalleryA/View/3' ...

In MVC, 1 model 1 tables or 1 model several tables?

In MVC, 1 model 1 tables or 1 model several tables? I am building an application that contain 3 tables. I don't know whether I should create one model for all 3 tables or create 3 models for 3 tables. In the case I use 3 models for 3 tables, where should I put the code if I want to join these 3 tables? Put the code in any one of 3 mode...

(Better practice) How do you put JSON result in ASP.net MVC Framework?

Currently I am using the terrific Linq 2 Json.net (by newtonsoft), which is a very great simple tool to generate JSON result in programatic way. But after finishing some projects, I stopped and rethink, should I generate the JSON result in the controller? I mean, in .net MVC framework, it DOES provided a JSONResult as one of the ViewRe...

God Controllers - How to prevent them?

In a few MVC projects I've been working on, it has become apparent that there are a few problematic controllers that have organically grown into God classes - demi-gods each in their own domain, if you will. This question might be more of a matter 'what goes where,' but I think it's an important question with regards to SRP (Single Re...

Where is an example of a Complex ASP.net MVC model?

I'm looking for an example of a more complex asp.net mvc model. All of the Models I've seen on the ASP.net site are very, very simple and involve only one or two database tables. I'm curious as to how mvc works with more complex models with many tables and ternary relationships. ...

how to use executecommand() to dynamically insert rows into database without calling submit changes in mvc, linq, vb

how i can insert a table from one datacontext say table1 to be inserted into other datacontext using linq in mvc without using insertonsubmit(). my user code is following Public Class PayController Inherits System.Web.Mvc.Controller ' ' GET: /Pay/ Private t As New PayRollMVC.DataContext1() Private c As New PayRollMVC.DataContext2(...

Why is ASP.NET MVC ignoring my trailing slash?

Consider the following route: routes.MapRoute( "Service", // Route name "service/", // URL with parameters new {controller = "CustomerService", action = "Index"} // Parameter defaults ); Using Url.Action("Service", "CustomerService") produces an url of /service instead of the expected /service/ Is ...