mvc

Update MVC model with local time offset

I'm trying to learn asp.net MVC and got stuck on this. I have model that contains a DateTime value in UTC (OrderDate). I would like to add the local time offset (lto) to this OrderDate so that the client see OrderDate in his local time zone. My approach is to use a Javascript as follows in the master page header: function GetLocalOffs...

In MVC where do you put references to your model Classes?

I have been wondering for a while, after asking different people and without any of them providing what I would call an "at least a bit concrete answer": Question: Where, in an iPhone application should an application keep the references to it's Model Classes (using the MVC approach) ? In iPhone (and Cocoa) applications we have what w...

Apache Tiles 2.1.4 with CSS

Hi, I am using Apache Tiles 2.1.4 with Spring MVC 3. I have managed to configure these together and everything works fine. My next step is to add CSS and this is where I am having an issue - this is most probably a simple one but I can't get my template jsp to pick up the css. Snippet from my tiles-defs.xml <definition name="baseLayou...

Getting a 404 when setting up MVC in IIS 6 and using .NET 4 beta 2

Hi all, I've completed this set up on a fair few IIS 6 boxes, but one is giving me a tough time. The problem occurs when I add the application extension mapping to: c:\windows\microsoft.net\framework\v4.0.21006\aspnet_isapi.dll When this is in place, I get a 404 error on every request. Even if I remove all files from the application...

PHP MVC gradual transition from CodeCharge to _____ ?

I'm working with a large legacy project created using CodeCharge Studio. We're looking to get away from CodeCharge, as we really don't like it (for a number of reasons). We're not going to be able to rewrite the entire project at once, it's going to happen in increments. As a result, I need this question answered: which of the other po...

ViewData.Model and ViewData.Eval

In my Controller I have been setting ViewData.Model = DBModel.Table.Take(1).Single(); Where DBModel is create by DBML file of Linq-to-SQL And I can access the Value thro' ViewData.Eval("ColumnName"), But If I create my own class Class Test{ public string Col = "Testing ViewData"; } Test objTest = new Test(); ViewData.Model = o...

Where's a good article or tutorial to learn more about MVC on the iPhoneOS

Basically what the title says, where is a good tutorial or article about Model-View-Controller relationships that is relevant or specifically about the iPhoneOS? ...

save page in php

Hi all, I am writing a web program using mvc php framework. I have index and another view which I want to render the view inside of my index. First I call view then I call index and put view into it. My problem is I want to save the whole view into a variable and do something like echo $view in my index. both require_once and include_onc...

MVC generates two input fields for the same bool property. How do I stop it?

C#, MVC 2 RC 2... I have the following property on my model class: [Required] [DataType(DataType.Custom)] [DisplayName("Show Favourites")] public bool ShowFavourites { get; set; } And the following HTML in the view ASPX: <div class="editor-label"> <%= Html.LabelFor(model => model.ShowFavourites) %> </div> <div cl...

Replacement for ITemplate in MVC?

I am currently running a website, i use a control that inherits from ITemplate to wrap all my usercontrols in. basically what it is, is a table with a nice border, and i am able to dump anything in there, so if i change the container template, all the containers accross the site changes... I am now in the process of rebuilding the ent...

Advice for setting up a static file server with ASP.NET/ASP.NET MVC

I would like to set up a subdomain (similar to stackoverflow's http://sstatic.net/) in order to serve static content for my existing web applications. I have never done this before and was wondering if anyone has advice - which technology to use (i am using the Microsoft stack), how i should structure the static site, what are the securi...

Zend Framework: How to construct a simple "Data Mapper" model?

I'm building an application in the Zend Framework, but I'd like to implement a "Data Mapper" style ORM layer, constructing Model classes that only include the specific pieces of data they need to represent the domain concept (regardless of which tables those fields happen to belong to). Since my DB structure is highly normalized, the ben...

Design Pattern for Data Processing? (MVC alternative)

As a PHP/Web Developer, I'm a huge fan of MVC (Model-View-Controller). I love building an app on a solid foundation which definitely separates business logic, presentation logic, and flow of control. However, I do a lot of work as well on server-side-only apps, which merely process data and log the process and any relevant results (such...

What persionalization techniques am I missing for multi-tenant systems?

Hey guys and gals, I am working on a scientific paper about persionalization in multi-tenancy web information systems. The question I have is whether I am missing a personalization technique in the following list: The first personalization is that of model change, where the underlying (data-) model is adjusted to fit a tenant's needs....

unit testing IDataErrorInfo with tryupdatemodel in MVC

Hi, I'm trying to unit test a controller action in which I call tryupdatemodel, but the validation does not fire. When I run my application the validation occurs and is fine. My guess is the the model binder is not loaded in test scenarios, how can I test my action ? here is the code Company object public partial class Company : ID...

Check if file is finished copying

Hi everyone, I'm writing an ASP.NET webapp that will copy the contents of a CD to a network share. I need to check periodically if the copy job is finished. One way of doing this is checking the network share folder to see if the file size has changed since the last check, but that seems kind of dodgy. Does anyone have a better idea h...

ASP MVC - Having different action handlers invoked depending on query params?

I would like different a different action to handle a request depending on query parameters values. For example: mydomain.com/controller/action?version=1&msg=hello and mydomain.com/controller/action?version=2&msg=5 should go to a different handlers based on the version value. The list of query params required/optional, as well as...

How do I find out the error count in a ASP.NET MVC View?

I want to format the title of my ValidationSummary using a string something like: "There are {0} errors on this page." How do I find out the number of errors without doing it in the controller and adding it to ViewData? ...

Using the MVC model with Swing Application Framework

I'm trying to create a simple Java desktop application using the Swing Application Framework and the MVC model but I'm struggling on some areas because there is a lack of good examples (the only SAF examples I have found are anything but MVC!). I manage to fire events from components, but apart from that I struggle to use the MVC model ...

Where to connect to DB in MVC

I am using php and building an MVC for my web application. I am to the step where I need to connect to my DB, look at the current URL, compare that to data in my DB, and then return the correct content from my DB to the user. My question is, where should I put the code that connects to the DB and processes it? Would this go in the Mod...