mvc

MVC Dropdown child properties failing modelstate.

HI All, I have created a dropdown for my view which works well up to saving the data. The Model State shows invalid on the object that is selected in my dropdown list. EG. I have a "Asset" which has a "Project" dropdown list. When I save the Asset the correct ID is in place for the Project from the dropdown list, but the Project itself...

DefaultBinder in MVC problem

Hi! I just started working in MVC and I have a problem: public class ServicePhone { public int AgreementId { get; set; } public List<PhoneNumber> Phones { get; set; } public ServicePhone() { Phones = new List<PhoneNumber>(); } public PhoneNumber NewPhone { get; set; } } public class PhoneNumber { p...

Rails Namespace Controller Issue

I've split my rails app into a admin directory and a public directory. The admin directory is within an Admin:: namespace (/admin). When I created a controller called Forums in both the Admin:: namespace and the normal root map area, the routing seems to find the Admin::Forums controller for /forums and /admin/forums. So /admin/forums...

MVC and command pattern

Hello there Ok, this is kinda dumb. I'm trying to wrap my head around the use of the MVC and Command Patterns. The questions basically concern where to place code. In the MVC pattern, where are the Commands instantiated? Are they created by the Controller, or are they contained fully in the Model or neither. BTW, Should one be using...

Model or Library class

Hello Im going to do an Email class for sending emails in my MVC framework. I also have a login class that just checks if the user is in the database. Should I put those classes in the library folder or should I implement them as models? I tried to do search but couldnt find straight answer.. ...

Scripts inside partial view not working when displayed using Ajax Actionlink

Partial View <script type="text/javascript"> $(function() { alert("Message"); }); </script> User Control Text View <%= Ajax.ActionLink("Show Control", "ShowControl", "Home", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "controlPanel" })%> <div id="controlPanell"></div> Controller public ActionResult ShowControl(...

What's your greatest tips when it comes to MVC Framework

Over the past few years I have built several MVC Frameworks and scraped them several MVC Frameworks. Usually I build my frameworks with a startup file which loads the main components (controller/library/input/output/error/configLoader/database model loader) etc. I'm just wondering how you build yours in an attempt for me to discover ne...

Which MVC flavor is more widely accepted?

I notice 2 distinct "flavors" of MVC: 1) "Original" MVC where the Model talks directly to the View 2) "Apple Cocoa" MVC where the Controller uses the Mediator pattern and Model and View never communicate directly From link text: The goal of MVC is, by decoupling models and views, to reduce the complexity in architectural design an...

ASP.Net MVC FileStreamResult, valid chars for FileDownloadName

Hi, I have an action method that returns a FileStreamResult, the download works fine, the problem is that although I set the FileDownloadName property of the result object, some of the files are downloaded with another name (specifically the last part of the address of the page I'm working on. e.g. in the page "http://localhost:5479/Ite...

MVC area and virtual folders

I'd like the ability to add a sub "folder" to an MVC area. For instance, I have an area ~/areas/Support And, in some classic ASP code, I need to refer to an include file <!-- #include virtual="/Support/_inc/myinclude.asp"--> Just for grins I tried including a virtual folder /support that points to this virtual folder, but that, of...

How resilient should my web app be?

Lately, I've found myself in quite a few arguments with my boss about the handling of exceptions within our web app (a c# asp.net MVC application). Basically the conversations go something like this: Boss: "There is something wrong with our program, client x's database went down today and everyone is seeing the error page." Me: "Mostl...

MVC 2 website - Cant get a list of files in the images folder

Hi all, I have created a wedsite using MVC 2 and C#. one of the pages is a gallery of product images. i have stored the path to the pictures in the Db eg ../../Content/ProductImages/ in the controler i want to do a foreach and get a list of the files to dispaly. i tried the code below : List<string> files = new List<string>(); string p...

Need guidance regarding the correct flow of my PHP MVC Framework

I'm creating a PHP web application framework (MVC). I'd rather not use external libraries or components (as I want this to be purely my work for now) Can you tell me some tips/guidance for what each of my files should be responsible for doing? Such as, what should be handled by the Framework script and what should be handled by an Appli...

Structuring models in MVC framework?

I'm wondering if there's a best practice for this, I'm building a site that's going to require quite a few models and I don't want to end up with a unstructured mess. Basically I'm looking for a good rulesheet to structure out the models. Right now I can only think of two ways: Every table in the db has its own model, ie. accounts.php,...

MVC add child to parent

Hi, assuming I have a Child and Parent object each of which has a repository and a controller. Update: A Parent has many Child objects. the parent's controller for creating would look something like. the post to create will be made using the auto-generated form. public ActionResult Create() { return View(); } ...

Accessing route values in view Mvc.net

hi everyone, i m using default route of mvc2 like {controller}/{action}/{id}. i want to access that id field in view. how can i do that without using tempData and ViewData. if i have url like http://server-name/home/edit/14 i need value 14 in aspx view any help is highly appreciated regards Adeel ...

regular expression for physical path

can someone tell me the javascript regular expression for physical path like 1) User Should enter something like this in the textbox( c://Folder1/) . Maybe in d: or e: 2) But after that acceptable a) (c://Folder1/Folder2/) b) (d://Folder1/Folder2/Folder3/abc.txt) e) (c://Folder1/Folder2/Folder3/abc.txt) ...

ASP.Net MVC 2,0 EditorForModel Question

Hi All I have written an Enum extension method that allows me to create a view model and allows me to easily bind a generic Enum to a SelctList like: this.ProductStatusList = new ProductStatusTypes().BindToSelectList<ProductStatusTypes> (product.Status.ToString()); In my View I can then have: <% using (Html.BeginForm()) {%> ...

Spring-MVC Common Model Attributes Used in Tags or Page Fragments

It's common to have many pages in a website that request the same model attributes, for example, a header that renders the current users name, or a column that needs a few server based pieces of information. ... <body> <mytaglib:header/> ... <jsp:include page="footer.jsp"/> ... </body> The simplest solution is that every controller me...

MVC object referencing

Hi, I set up a project using MVC (to be more specific this is Hello Poly part 2 from Stanford) and I'm having problems referencing object. So I have Model which is PolygonShape class, Controller - controller, and View - PolygonView. I made outlets in Controller : IBOutlet PolygonShape *myShape; IBOutlet PolygonView *myView; ...