controller

View controller chain

I have a Navigation Controller with a root table view which has several links. Tapping each link moves to the next view (by pushing it to the navigation controller's stack). But suppose that in that "next view", I have a UIButton that should take me further to another view (by pushing on to the same navigation controller's stack)... Vie...

How to handle 404's with Regex-based routing?

Please consider the following very rudimentary "controllers" (functions in this case, for simplicity): function Index() { var_dump(__FUNCTION__); // show the "Index" page } function Send($n) { var_dump(__FUNCTION__, func_get_args()); // placeholder controller } function Receive($n) { var_dump(__FUNCTION__, func_get_args())...

Getting the Current controller and action sent to the Route

Hello, I am attempting to Get the current controller and action being called in the route. In my Global.asax.cs I have the following using and the following line: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; using IProwlAdminUI.Models; *** LINE WIT...

Data not saving in MVC2 Edit_Post controller action

My View inherits a strongly-typed object. My Edit (Get) controller action returns a View, passing to it the model object. When my Edit (Post) controller action accepts a FormCollection object, calling UpdateModel and db.Save() works fine. If I change the Edit (Post) controller action to accept the strongly-typed object instead of the ...

Calling the Session before any Controller Action is run in MVC

Hi, I have this authentication check in my global.asax file in the Session_OnStart() call: if (Session["Authenticated"] == null) { Response.Redirect("~/Login.aspx"); } This kind of session authentication is tightly coupled in all our web apps so I have to use it this way. This global.asax sits in an older ...

Why does rails generate object instance variables in controllers

Why does rails use @poop object instance variables instead of just a local poop variable in the generated code? Is there some foreseen common situation where it's useful rather than simply using a local variable here? I would think it makes sense to use a local variable and not attach something to the object namespace unless you need it ...

Zend Framework choose controller from Plugin

Is it possible to choose controller from Plugin? For example I have table of departments and categories in database. I'm fetching them and want to make certain actions(picking controller and action). The reason - I don't want to create sepparate controller for each department and action for each category. ...

How to "push" view controller to be 2nd page in page control?

How would I push my 2nd view controller to be the 2nd page in page control. I am using scroll view too? Any help pleaseeee? ...

ASP.Net MVC - Sending an object from controller to view to controller

Hi everybody, I'm just starting with ASP.Net MVC 2 and might be doing something wrong. I have a controller who builds some objects and passes them to a view using ViewData. In the view I display the data etc ... and then want to submit the same data (plus other user input) back to the same controller. Is there any simple way to do this ...

Call an action in a controller and continue with the view from the same point with the same info

Hello, What I am looking to do is have my site.master call a specific controller action, and then continue to process the current request without any view or information change. I want to do this in the site.master because I want this action to run on every page that is loaded, and since all pages use my site.master (as I have not creat...

ASP.NET MVC2 - Redirect to Url in overriden controller

I've created a ControllerBase class that overrides the Execute method of the default Controller class. I'm doing this to check the url and pull an associated page from our database. If the page isn't found, I want to redirect to a specific url ("invalid-page"). All is working except the redirect. I've tried to use Response.Redirect("inva...

Spring 3 Annotated Configuration Picks up @Configuration and @Component but not @Controller

So I'm trying to configure my web app without XML and go the all annotated route. I have a few classes annotated with @Configuration and @Component that are getting picked up automatically, but for some reason my @Controller annotations aren't being recognized and mapped to their corresponding @RequestMapping values. My web.xml file loo...

GRASP's Controllers and MVC's Controllers question

Introduction to the problem I have been taught about OO Analysis and Design through Craig Larman's Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development, that follows the UP(Unified Process). When using it, we usually draw a Domain Model and from it, doing Interaction/Association Di...

Getting controller's name inside behavior

Im writing ClearCache behavior. It's purpose is to delete some of custom cache files on every afterSave and afterDelete event of the model. In order to delete right files i need to know name of controller and the name of action that called ModelWithClearCacheBehavior->save() or ModelWithClearCacheBehavior->delete() My question is: How...

How to register scripts and stylesheets at Controller level

Hi. I want to be able to register scripts and stylesheets. These items would then be added to the head section of the current page. For example, I have a partial view called ImageViewer that renders a few images and relies on a script. Instead of adding this script in the view using the ImageViewer, I'd like to be able to register this s...

Breaking Down NSTabView Into Files

As my Cocoa app comes along, my NSWindowController is becoming huuuuuuuuuuge. My window has an NSTabView, and each tab therein has its own NSViewController (they all have submenus) and its own methods. So, my WindowController.m seems to stretch well beyond what it's supposed to because of tabs. Sadly, examples of NSTabView are quite sim...

Cookies, updating the expiration date on each request in mvc

I have a fairly simple web app that uses cookies to store some information about the user and to authorize them on each request. When the user first logs into the site a cookie is created and some encrypted information is stored in there, the expiration is set for the current time plus 24 hrs. What I want to achieve is that whilst a user...

Zend Framework and Preventing Fat Controllers

Avoiding Fat Controller So I'm using Zend Framework and I have a question involving preventing fat controllers with one of my actions. Basically I am normalizing a CSV file into my database. This means that I have to get the feed and then use my model. The feed grabbing is just there to show how it works, but that is now an Action Hel...

Partial containing a form appears in both controllers, but fails to submit on one of them

I have a partial that contains a form: <% form_for :message, :url => { :action => "create" }, :html => { :id => 'form' } do |f| %> <%= f.error_messages %> <%= f.label :title, "title" %> <%= f.text_field :title %> <%= f.label :tag, "tag" %> <% if controller.controller_name == "tags" %> <%= f.text_field :tag_list, :value =...

[zend] best practice on rendering several views based on same dynamic data

HI all, I would like to have some input on the following: I would like some views to be systematically rendered (I can call $this->render from my layout for these views) regardless of which controller/action is executed. However the content used in these views is based on the same dynamically generated data and the code behind it is q...