mvc

where to store large static array in MVC structure?

I have a long php array which I loop through and create a form with. I am going to create a YAML file for it, for ease of maintenance. My problem is I don't know where the appropriate place is to store this file, and how would i invoke it from the view. ...

ASP.NET MVC Ajax: How to update an Ajax.ActionLink itself on-click

I have a page that displays a list with a of elements with a large number of elements, each of which has a boolean property, representing an Enabled and a Disabled state. I need to provide the user with a link for each list item, and the link text must show the opposite status (so if the item is enabled, the link text must display 'Disa...

asp.net MVC creating my own routes

hi i am trying to create a URL that looks like this: black/granite/worktops where the black and granite will change so i have tried to create my own routes in global.asax.cs like so: routes.MapRoute("Kitchen", "kitchen/[color]/[surface]/[type]", new {controller = "kitchen", action = "surface"}); changing the...

Password hashing etc in Service Layer or Repository?

As a matter of best practice in MVC, where should the logic go that deals with things such as password hashing/salting or data formatting before it gets sent to the database? I've read that the repository should only be used for logic that deals with data access. Is this something that belongs in a service layer? The controller? Does it ...

does the 'getters and setters are evil' fail for the view layer?

Many people know this article: more on getters and setters. I think it does a convincing job of portraying the evil side of getters/setters. I've also tested it by trying to convert an existing project (unfinished) to code without getters/setters. It worked. Code readability improved greatly, less code and I've even managed to get rid of...

Making Custom Ecommerce App: ASP.NET MVC or Forms?

I am tasked with making a custom ecommerce app that will populate purchase options from a table and keep track of orders, call paypal, etc. It will be pretty much like 'select options', 'enter payment info', 'confirm payment', 'setup account (now that payment is done)'. Another team here at the office is using MVC for a new project which...

Are there any Ajax windowing frameworks out there?

I have a project with a lot of pop-up layering going on and while i will have one layer open, that layer will effectively serve as another window. I'm currently managing this with _json specific return pages that just return json objects and the layer acts on that. Each call from the layer is from a jquery .ajax call which processes ...

ASP.Net MvC framework, Html.ValidationMessage tag

In this code in an Edit view, the correct vendor name text appears but it is not validated when I blank its textbox and push Save. The Vendor is a property of the Order model, and VendorName is a property in the Vendor model. They relate referentially. My form does not all input into a single table, but on satellite tables as well. <%= ...

How do view controllers work in the iPhone SDK?

I have just started developing iPhone applications and I am very confused by how the "view controller" aspect of the user interface works. I did the "Your First iPhone Application" tutorial on the Dev Center. It has you set up your own view controller class and then initialize it using initWithNibName. So it seems that nib files contain...

Using a CMS to Design a Web Application

Is it at all practical to try to use Joomla or Drupal to design anything but brochure-ware or a blogging website? Are the modules/extensions frameworks really flexible enough for designing web applications that have a lot of data entry and reporting capabilities, or would you just be better designing it using a MVC framework, ASP.NET or ...

authentication problem on windows vista (cookie is getting written but httpcontext.current.user is null)

authentication problem on windows vista (iis7) (cookie is getting written but httpcontext.current.user is null) ...

Defining a User with User.Identity.Name in controller constructor

For my actions that are going to interact with the User's account, I would like to create a "TheUser" object in addition to adding that object to "ViewData["TheUser"]" as soon as any action on my controller is called. If the User is logged in, it will grab the User's info from the database, if not, "TheUser" object will just be null. I...

PHP MVC & SQL minus Model

I've been reading several articles on MVC and had a few questions I was hoping someone could possibly assist me in answering. Firstly if MODEL is a representation of the data and a means in which to manipulate that data, then a Data Access Object (DAO) with a certain level of abstraction using a common interface should be sufficient for...

Does php mvc framework agavi use CRUD compliant to REST?

The agavi framework uses the PUT request for create and POST for updating information. Usually in REST this is used the other way around (often referring to POST adding information while PUT replacing the whole data record). If I understand it correctly, the important issue is that PUT must be idempotent, while POST does not have this r...

Routing an hiearchical path from DB with ASP.Net MVC

Hi, is it possible to route an hiearchical path to map an relation from the database as follows: Lets say I have an tuple/entity "page" with an m-t-m relation to a "page" (it selfe) and I want to be able to combine the slug-value of each page to find an appropriate page, like so: mydomain.com/firstpage/secondpage/thirdpage where first...

How in ASP.NET MVC to change Url.Encode character replacement strategy?

I'm using Url.Encode within a view and it's replacing spaces with + so instead of: /production/cats-the-musical I'm getting .../cats+the+musical. I'm sure this is an easy one, but where do you go to configuring which characters are used for this? I'll be doing this: public static string EncodeForSEO(this UrlHelper helper, string unen...

How do I write a link to a static file in ASP.NET MVC?

In my MVC application I have a folder full of PDF documents users should be able to view. However, my links to them don't seem to work: I get a "resource can't be found error". I'm guessing my problem has something to do with routing. What do I need to do so that the browser just renders the documents? ...

Facebook Connect + MVC Model

Hey everyone, I am working on an ASP.NET MVC project and I am trying to get it integrated with facebook by using facebook connect API. Now, I am having a small problem in imagining how the conceptual layout would be. I am using the repository model in MVC, I have my own DB. I want to be able to fetch user’s information from FB, and may...

MVC - UpdateModel and DropDownLists

Hi I am doing MVC and have look-up values in drop down lists. When calling UpdateModel only values before the look-ups get updated and nothing afyer. I get no errors though. I can edit and create and use the following code in my cintroller: ViewData["SiteMaintenanceId"] = from m in this._siteRepository.FindAllSiteMaintenances().ToLi...

Dynamic urls / MVC

Let's say my main controller 'hotels' has a pattern for the url, such as: /hotels/colorado/aspen/hotel-name/ How should I program my controller ( keep in mind I'm still learning MVC ) to handle this variable? I know that I have to probably check if anything after /hotels/ is set, otherwise show the default hotels page. If a state is s...