mvc

MVC Repository Pattern: Creating Model Classes

Reviewing Conery's storefront, and I dont understand why he used Linqs auto-generated classes (ie Order class) and then he has another Order class defined that is not a partial class. WHen using repository pattern should one manually create the classes, and disregard Datacontext altogether? ...

Zend_Framework- Where to Place $_GET and $_POST (HTTP Request) handling?

I recently read this post which led to a series of other posts that all seem to suggest the same idea: Models do everything, the View should be able to communicate directly with the model and vice versa all while the Controller stays out of the way. However, all of the examples shown are fairly simplistic and none really show an example ...

MVC Model: submitting multiple objects to the View

im not sure if there is a difference in these two methods. If so, which would be considered the better practice when submitting more than one object to the View. 1- Having the controller make separate calls to the datalayer for each object model and then wrapping the objects in a model to send to view. 2- Defining a "presentation" mode...

robots.txt in ASP.NET MVC app returning 404

I've deployed an ASP.NET MVC site with a robots.txt file in the root but when I try and access this url it's returning 404. I have an .xml and a .html file in the root as well and they return valid content. I'm running this on IIS 6. I've tried adding .txt as "text/plain" to the MIME Types but no luck. Suggestions? ...

asp.net mvc - How i convert local file path string to http url

After saved upload file, i got local url of this file, how i convert it to http url? ...

Why should I use templating system in PHP?

Why should I use templating system in PHP? The reasoning behind my question is: PHP itself is feature rich templating system, why should I install another template engine? The only two pros I found so far are: A bit cleaner syntax (sometimes) Template engine is not usually powerful enough to implement business logic so it forces you ...

Can you overload controller methods in ASP.Net MVC?

Im curious to see if you can overload controller methods in ASP.Net MVC. Whenever I try, I get the error below. The two methods accept different arguements. Is this something that cannot be done? The current request for action 'MyMethod' on controller type 'MyController' is ambiguous between the following action methods: ...

In MVC, should pagination info go in the path or querystring?

In the path: Format: http://mydomain.com/{category}/{subcategory}/{pageNumber}/{pageSize} Example: http://mydomain.com/books/thriller/3/25 In the querystring: Format: http://mydomain.com/{category}/{subcategory}? pageNumber={pageNumber}&pageSize={pageSize} Example: http://mydomain.com/books/thriller?pageNumber=3&pageSize=25 I l...

How do you handle reporting filters in ASP.NET MVC?

For a given report, the user will want to have multiple filtering options. This isn't bad when the options are enumerations, and other 'static' data types, however things can get silly fast when you need a select list that is populated by fields stored in a table in the backend. How do you handle this scenario? I find myself constantl...

"Connecting" nonGUI objects to GUI objects.

I have a set of nonGUI objects which have a one to one realtionship with GUI objects. All events are routed through the top level window. Many ( not all ) events occuring on the GUI object result in calling a method on the associated object. Some methods in the NonGui objects which when called change the GUI objects. One example wo...

Is there any good way to convert existing YUI based scripts into JQuery code?

My site was based in YUI, but since I plan to upgrade my site to .NET MVC and JQuery is MVC friendly, so I plan to convert my existing YUI scripts to JQuery. ...

How do you make a class listen for PropertyChangeEvents caused by other classes, but not this class?

As described in another question, I have a set of Model objects and an associated set of Panel objects which allow the user to access the data in the Model objects. The Panels are registered as PropertyChangeListeners for the Models, such that if something else updates a value in a Model, it fires a PropertyChangeEvent, and the Panel re...

Repository Pattern - MVC storefront

Have been looking at the MVC storefront and see that IQueryable is returned from the repository classes. Wondering if you are not using LINQ does it makes sense to return that object? In the case of LINQ in makes sense because of deferred execution, so adding filtering in the service layer makes sense, but if you don't use LINQ you wou...

Passing information to usercontrol in ASP.NET MVC

hi everyone, I know how pass viewdata into a user control which is like this <% Html.RenderPartial("someUserControl.ascx", viewData); %> This is what i want to do: In the current situation i have events calendar and each section of my events calendar is a wired to a user control, so ideally when i pass a date value to my user contr...

MVC in .NET: How to not duplicate classes?

I have a Person class in the Model and want to assign 15 of its attributes to labels in the View. The View shouldn't access the Model. That means the Controller will handle creating the Person. How does the View get these Person attributes from the Controller? If the Controller contains a member of Type Person, the View can do someth...

VS2008 SP1: Pressing F5 takes ages to start website

I have a Silverlight project (with ASP.net MVC web project) Suddenly, when I press F5 it takes like 20 seconds, from the moment that Internet explorer opens, to when the debugger is attached. Mind you, it is a project that works perfectly since about 3 months. The problem just started last days. When I start without debugging, everythi...

Is this part of MVC in .NET?

I have a .NET MVC winform app. I've created an AppDelegate class that handles application startup and shutdown...for now (it might do more later). Winform apps have a Program.cs file that does some app initialization, starts the message pump and creates the first form. In my app, the first form is AppDelegate, which isn't really a fo...

where should I save a complex MVC application UI state?

I've been having a look at several MVC frameworks (like rails, merb, cakephp, codeignitier, and similars...) All the samples I've seen are basically plain and simple CRUD pages, carrying all the infr needed in the querystring and the posted field values. I've got a couple of apps made with some sort of framework built with classic asp....

Data modeling question - separation of data and calculation and accessor logic

Ok, so I wanted to get opinions on this topic. I have a dumb data object - CustomerOrder. CustomerOrder has a price and a quantity but also has a TotalCash property (price * quantity). so I have a totalCash property but I dont want to put the calculation into the object directly because that would be breaking the dumb data object rule...

In .NET MVC, can we keep the CSS inside the Views folder?

I am working with ASP.Net MVC. When I keep the css inside the Views folder, its not loading the CSS. Can anybody help me regarding this issue? ...