controller

Calling a controller from another

Hi, I want to call an action of a controller from another controller. How can I do this? Some years ago, there were compononents, but they are not available any more. Best regards ...

Controller Test problems

Hi. I want to test a mvc controller. I'm using Moq to mock the services, but I don't know how to mock this.Request.Files["Attachement1"] and this.Server.MapPath("~/Temp") ("this" is the controller) I tried to create a new Mock<HttpRequestBase>(); but this.Request doesn't have a setter. Help me please with an advise. Thanks ...

Sending String Data to MVC Controller using jQuery $.ajax() and $.post()

Hi all, There's got to be something I'm missing. I've tried using $.ajax() and $.post() to send a string to my ASP.NET MVC Controller, and while the Controller is being reached, the string is null when it gets there. So here is the post method I tried: $.post("/Journal/SaveEntry", JSONstring); And here is the ajax method I tried: $....

How to intercept and translate USB events

I would like to use the Philips LFH-2330 to view images (with Windows Image Viewer or another viewer such as IrfanView, etc.) The LFH-2330 is a foot controller with four pedals (see here for example) used to control audio playback software for transcription. It comes with its own driver and software. The simplest setup for me would be ...

ASP.NET MVC Ajax Form - If value changes in Model after post, Form still displays old value

This behavior is making me wonder about my sanity.. I have a form that has two places that accept input, let's call them ValueA and ValueB. The user can enter a value in either one and the form submits. <div id="MyUpdateTarget"> <% using (Ajax.BeginForm("MyControllerAction", new AjaxOptions { UpdateTargetId = "MyUpdateTarget" })) { %>...

Zend: How to nest different controllers into one big?

What are (the best) approaches for the Zend Framework to nest different controllers actions into one big one? And how would I solve the following situation: A link in my main big view calls an other view where I can select a specific value and come back automatically after selecting to the main view and pre-filling this selected value? ...

Custom View as a Toolbar in a Navigation Controller

I'm working on getting a view to act as a static toolbar within a navigation controller. Is it possible to do this? I know you're not supposed to subclass a Nav controller but I tried it anyway adding a subview that will serve as a toolbar. Long story short, the subview didn't even pop up on the display. Can someone advise me on thi...

Designing mvc controller layer

Hi, I am trying to understand and practice the MVC-pattern to improve my development. So I started refactoring an application I once wrote and have progressed so far. It is completely clear how my model looks like and also the view is ready so far. But now I am searching for a good practice to design my controller layer. I have created a...

Cakephp: Abstracting AppController another level, possible?

Hi All, I was wondering if it's somehow possible to add another abstraction controller between AppController and my app's other controllers? So that my controllers, e.g. UsersController extends SecureController and SecureController extends AppController. Also I want to be able to have other controllers extend AppController directly: So...

Spring Form: Submitting extra parameter on submit buttons

Hi, I am working on a form with a bunch of selection criteria that will generate a report when the form is submitted. I also have a number of different reports that can be generated form this same criteria, and want the type of report to be selectable by using a tab system where each tab clicked on submits the form and generates the cor...

creating functions in CodeIgniter controllers

Hi I have a CodeIgniter application, but one of my controllers must call a data processing function that I have also written myself. The only problem is I can't seem to figure out how to do this. Looking through the user guide it seems that I should put my function inside the class declaration, and prefix it with an underscore (_) so th...

Behavior of a controller action on reception of a null dto

When a controller detects that a DTO passed to it is null should it instantiate an instance of the DTO (cf the Null Object Pattern), or should it simply throw an exception there and then? Thanks ...

Insert two rows on one create action in controller

I have a form that is used to record a transaction. Liquid is moved from one tank to another. My form takes the from tank and the to tank and the number of gallons transferred. i would like this to be entered into the database as two rows. The first would be the from Tank ID and a negative number and the second row would be the to Ta...

Is there a way to have a Codeigniter controller return an image?

Hey, I was wondering if there was a way for a controller to, instead of returning a string, or a view, return an image (be it JPG, PNG etc). For example, instead of ending with a $this->load->view('folder/special_view.php), I'd like to do something like $this->load->image('images/gorilla.png'), and have it so if my user were to go to t...

Is there an ASP.NET MVC controller that can auto-handle JSON/XML/Views?

Is there an ASP.NET MVC controller or helper class that can automatically return the proper HTTP response based on the HTTP request header? I'd like it to be able to return JSON, XML, or a View based on the request's content type, with the only thing I have to do is populate some global Model object with data from the database. ...

Search Controller is not showing up in TableView Controller.

I draged and dropped Search Display Controller onto my TableView Controller. When I push that TableView controller from RootView controller, Search Bar is not showing up on the top of the TableView. I used the same technique for the rootview controller and I could see SearchBar on the top of my TableView. What could possibly cause that...

How to populate strongly typed viewdata from a base controller?

All my controllers are based off of a BaseController, to share properties between them and override OnActionExecuting to set some values based on the route. I'm creating a BaseViewData class to do the same for all my view data. At the moment I'm populating the view data like so (C#): var viewData = new BaseViewData { Name = "someN...

Json isn't returning a result that is accessible as an array...

I'm having troubles reading a Json result back from a controller method... I have this method in my controller: [AcceptVerbs(HttpVerbs.Post)] public JsonResult GetCurrent() { IList<string> profile = new List<string>(); profile.Add("-1"); profile.Add("Test"); profile.Add(""); return t...

Is making a BaseViewData class a property of a BaseController class a bad idea?

Every controller class in my project derive from a base controller class, aptly named BaseController. All view data is contained in a class named BaseViewData (which in the future could become the base controller for more specific view data classes). I made a BaseViewData property on the BaseController since every controller requires a...

Rendering Partial from outside main/index.rhtml...Ruby on Rails

Ok I have posted a couple of things that had to do with my problem but I think I have it narrowed down. Here is where I am at: I have my index.rhtml page inside of /views/main and the main_controller is set up correctly. I am attempting to make this page a dashboard of sorts so it needs to reference multiple other views to display their...