mvc

Asp.Net MVC Catchall Routing

I'm creating an application in MVC with some basic CMS like functionality. My goal is to have arbitrary routes like: "http://www.example.com/Academics/Athletics/Football/Boys/Calendar" to accomplish this, I've registered this route: routes.MapRoute( "Default", "{*path}", new { Controller = "Content", action = "View" } The View ac...

Are PHP MVC Controllers implemented by url rewrite?

The controller in a Java EE application may be represented by a servlet, which may be currently implemented using JavaServer Faces (JSF). But in PHP there is no such servlet,so I guess is it implemented by url rewrite? So that every request is directed to that controller? ...

Complete Ruby on Rails tutorial

I'm new to RoR, but familiar with MVC, REST, used a lot Symfony, Yii, CI and other smaller php frameworks. Now I want to learn Ruby on Rails. Please help me find a complete tutorial for "dummies", which describes creating web application from scratch on RoR. This is like Symfony's Askeet and Jobeet tutorials. Thanks for any help! Upda...

Get posted selected item from DropDownList in ASP MVC

Controller public ActionResult Create() { return View(new PageViewModel()); } [HttpPost] public ActionResult Create(Page page) { try { repPage.Add(page); repPage.Save(); return RedirectToAction("Edit"); } catch { return View(new PageViewModel()); } } PageViewModel public class PageViewM...

usefulness of microsoft data access application

Hi all, I am planning to start learning asp.net mvc. And also I want to learn Microsoft's Data Access application block. But I dont want to waste time in MDAC block if theres a better option to go for, or if MVC provides any good feature than MDAC. As I have heard MVC architecture automatically generates code. So, please guide me regardi...

How to supress re-post when refreshing a page - ASP.NET MVC

hi all, I am building a wizard using asp.net mvc. currently when the user hits next (or previous) the form values are posted to an action which does any processing required and then renders the next view. the problem i am having is that if the users hit refresh in that new view they get prompted to re-post the form values which causes...

Invalid Form Submissions-- what to do with them?

I've been doing a lot of reading lately about best practices when it comes to Web App design. My language of expertise is PHP/MySQL. When creating an MVC architecture for an application I'm developing, I always come across the problem of where to store invalid form submissions (so that the user doesn't have to re-enter the data, and help...

ASP.NET MVC ViewEngine ViewLocationCache.GetViewLocation returns null

Hi, I am following Chris Pietschmann's solution for theming in ASP.NET MVC. One thing I have noticed is that the view name is not being retrieved from the ViewLocationCache on subsequent requests. I am using ASP.NET MVC 2.0 RC When the following code is executed: this.ViewLocationCache.InsertViewLocation(controllerContext.HttpContext...

ASP.NET-MVC data/model best practices for a newb

Hey :) I am quite new to ASP.NET MVC and MVC in general. Moving from the old school "spaghetti" design practices to WebForms was a big change, but this seems bigger (but better) in my mind. I have some questions regarding data specific tasks. For the sake of simplicity, say I have a database table called PIN with the column structur...

Using Spring, mapping to root in web.xml, static resources aren't found

I'm not quite a newcomer to Spring but what I'm attempting now I've never done. Iteemed basic when I started but I've run into a problem. What I'm trying to do is map requests to the servlet root (correct terminology?). I'm at the point where URLs are mapped to correct view but all the static content - css, javascript, images - that is...

ASP.NET route passing string value

I'm trying to have a page on an ASP.NET MVC based web site where one page allows selecting by username instead of ID. I would have thought the route needs to be something like: routes.MapRoute( "CustomerView", "Customer/Details/{username}", new { username = "" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new {...

Upload a Flash file to server in ASP.NET MVC

Hi, I want to provide an option to upload a flash file onto my server for my customers. I am using ASP.NET MVC with VB. I am looking for code with in controller to upload file to my server and rename it, and the necessary security measures I need to consider. Any pointers to a reference is fine. Thanks in advance. ...

Should you validate in the Model? (Symfony based question, but related to general MVC)

Hi, This is a quick question relating to Symfony, but could be a general MVC question. I have a class in my model, for example, WebUser. This class has a property of email_address. This value must be unique to each WebUser. Now, I've made it so all my Symfony forms validate that the email_address is unique for the given WebUser, howev...

How does a view work (MVC)?

I'm working on a web-app without a framework right now, and I'm trying to structure it as a MVC app. The problem is, there are some technical aspects of MVC apps that escape me. Primarily, how should a view be build? I'd like to use a markup language like eRuby or #haml, but I don't know how exactly they work and how to implement them ...

How can i include the clicked element's id in an ajax call?

I'm trying to bring over the IDs of the input elements "submit" and "skip" and do some logic based on which button was pushed. It doesn't appear to be coming over in the Request object. How can I do this??? <div id="modal"> <% using (Ajax.BeginForm("Promo", new AjaxOptions { UpdateTargetId = "modal" })) { %> <div id="mo...

Codeigniter application design

Hello, I have several questions regarding CI application design. Q. When creating a new form and your using CI's form_helper I'm creating arrays in the controller and passing it to the view/form_input() method. Should I be doing this in the controller, the view, or a separate file? Q. In my controller, I create a method for my form...

Copy CD contents from cd storage server to network share

Hi all, I need to write a webapp (asp.net MVC) that copies the contents from a CD to a network share (eg. Z:\dir1). All servers are in the same domain. Process flow is as follows: - User inserts CD-ROM into cdserver1 (PrimeArray ProServer 3802 XT) - CD contents is copied to internal HDD automatically - User enters CD information in the ...

Simple MVC routing problem

I have few pages that quite similar to the others but one of them doesn't work. When I write 'http://localhost:2265/Segment/' I get annoying error message "Server Error in '/' Application. The resource cannot be found." Other pages like 'http://localhost:2265/User/' works very well AND also 'http://localhost:2265/Segment/Create'. So I...

ActionFilterAttribute: Where is the 'Cancel' property?

Whatever happened to the Cancel property on the ActionExecutingContext? How would one abort a RenderAction when using an ActionFilterAttribute or is there another way to skin this cat? public override void OnActionExecuting(ActionExecutingContext filterContext) { if(!filterContext.HttpContext.User.Identity.IsAuthenticated) { ...

Saving and restoring non-Parcelable UI state for a dumb widget

I have a "dumb" custom Android widget (as in View, not a home screen widget) that I need to have retain some state during screen rotations. This PlayerWidget is essentially a media player UI with some buttons (back, forward, play/pause) and a progress bar. It exposes the important bits of UI via getters. There are a few separate Activ...