mvc

MVC for a desktop application, connection a view/controller pair with another one

Hello. I've had mostly experience with "server-side" mvc frameworks very popular in different languages like ASP.NET MVC or Zend Framework for php, Spring for Java etc. Some of them are also possible to use for desktop applications development but I never tried that. I fully understand that design patterns should not limit implementati...

In Rails Can we pass a parameters to a new Action

i would like to write a message using an instince variable in the new invition action like this. redirect_to new_invitation_path("invite your friend") Controller invitations: def new(message) @message = message @from_user_id = facebook_session.user.to_s end Apparently it is not possible how can i find a way around this? ...

MVC for web development: Sign-up form?

How would I go about implementing a signup form using the MVC pattern for a website (I'm using PHP)? I think the controller should receive the POST data initially. Then probably some interation with the model might need to take place (if the user successfully signs up). Then I think the signup form view would be called, and a value woul...

What is difference of developing a website in MVC and 3-Tier or N-tier architecture?

What is difference of developing a website in MVC and 3-Tier or N-tier architecture? Which one is better? What are pros and cons? ...

ASP.NET MVC DropDownList Validation

Hello everybody, I have [DisplayName("Country")] public List<SelectListItem> Countries { get; set; } property in strong-type Model View class for DropDownList. When I try to check if the ModelState.IsValid on form postback it's always false & error for Countries tells "Can't convert [value] to SelectListItem" or some of a kind. I...

MVC: Nested Views, and Controllers (for a website)

I'm about to do a PHP website using the MVC pattern. I am not using a framework as the site is fairly simple and I feel that this will give me a good opportunity to learn about the pattern directly. I have a couple questions. Question 1: How should I organize my views? I'm thinking of having a Page view which will have the header and fo...

Processing variable number of form fields

I am working on a form which displays information about orders. Each order has a unique id, but they are not necessarily sequential on the form. Also, the number of fields can vary (one field per row on the form). The input into the form will not be mapped straight into the database, but will be added to the current value in the datab...

What does Controller.TryUpdateModel() do in detail? Why might it fail

I tried to use Controller.TryUpdateModel() of ASP.NET MVC. What does it do in detail. In my example it fails (i.e. returns false). So how can I find out, what is the reason for the failure? ...

linq to sql data annotation

[MetadataType(typeof(OrganizationGroupFormViewModel))] public partial class OrganizationGroup { } same name as generated in linq to sql? public class OrganizationGroupMeta { // datannotation validations comes here ? } public ActionResult Create() { OrganizationGroup OrgGroup = new OrganizationGroup ...

Compare Dates DataAnnotations Validation asp.net mvc

Lets say I have a StartDate and an EndDate and I wnt to check if the EndDate is not more then 3 months apart from the Start Date public class DateCompare : ValidationAttribute { public String StartDate { get; set; } public String EndDate { get; set; } //Constructor to take in the property names that are supposed to be che...

How can I ajax load new pages/views into MainContent when using a master page

Hello. Instead of using Html.ActionLink to load subpages into MainContent, I would like to load them with ajax. For example (taken from Site.Master): <%= Ajax.ActionLink("HOME", "Index", "Home", new AjaxOptions() { UpdateTargetId = "main" })%> <%= Ajax.ActionLink("ABOUT ME", "In...

404 in ASP.NET MVC with Integrated Pipeline mode

IIS 7.0 (Shared Hosting) ASP.NET 2.0 Integrated Pipeline mode MVC 1.0 I get a 404 on every url except /default.aspx. I have this in my web.config: <system.webServer> <defaultDocument enabled="true"> <files> <clear /> <add value="Default.aspx" /> </files> </defaultDocument> <directoryBrowse enabled="false" /> <val...

Swap Master Page used in View from a value selected in a DropDownList

I have a mvc app that currently is branded to one brand. I want to add a user control that will hold a list of brands and when the user makes a selection the Master Page is swapped out, the styles will also be changed as the stlye link is held on the Master Page. Has anyone done this before, is it possible and if so can anyone please s...

Get a selected radio button value after POST to set other fields enabled/disabled

I have an MVC application with a simple control to all selection of All Dates or selecting a Date Range. The radio buttons have an onclick handler to enable/disable the dat pickers. All work well so far. When I try to set the correct context state for the datepickers after doing a POST I cannot get the jQuery selector to return the rad...

Importing MEF-Plugins into MVC Controllers

Hello. There are several examples of using MEF to plugin whole controller/view packages into a MVC application, but i didn't found one, using MEF to plugin funcional parts, used by other controllers. For example, think of a NewsService with a simple interface like interface INewsService { List<NewsItem> GetAllNews(); } That gets ...

using dynamic as type of MVC strongly typed view

Hi, I have a page for creation of dynamic entities. <%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %> ... I have two actions: public ActionResult Create() { dynamic model = ... return View(model); } [HttpPost] public ActionResult Create(dynamic(1) entity) { ... } Well, th...

Why is my controller action not being called upon re-clicking the button?

First, some code: Here is the initial Action that is called when the page is navigated to: public ActionResult ListCodeTypes() { var CodeList = _entities.Master_Codes.ToList(); List<SelectListItem> items = new List<SelectListItem>(); for (int i = 0; i < CodeList.Count; i++) { items.Add(new SelectListItem { ...

What's the best way to transition to MVC coding?

It's been around 5 months since I picked up a PHP book and started coding in PHP. At first, I created all my sites without any organizational plan or MVC. I soon found out that was a pain.. Then I started to read on stackoverflow on how to separate php and html and that's what I have been doing ever since. Ex: profile.php <--this file ...

MVC as used in ObjectiveC programming.

I'm confused somewhat by the MVC implementation as used in Objective C programming. What is described as 'Controller' in Objective C tutorials and documentation, I understand as simply a view or mediator. Which is correct? ...

ASP.NET MVC 1.0 Model Binding + RadioButton Helper + Data Annotation

I'm having an annoying issue with the RadioButton helper and Data Annotation used for validation: I'm actually replacing a dropdown list with radio buttons (because the list is small). I'm not using MVC 2 or MVC Futures (though, I think I'd run into the same problem if I were using the RadioButtonList). That particular field is require...