controller-action Questions

4

Solved

We have a controller that derives from ControllerBase with an action like this: public async Task<ActionResult> Get(int id) { try { // Logic return Ok(someReturnValue); } catch { ret...
Siesta asked 18/3, 2020 at 12:59

3

Solved

In my ASP.NET MVC Application, I want to handle all requests sequentially; no action/controller code should be executed concurrently with another. If two requests come in at similar times, it shoul...
Lavine asked 20/6, 2014 at 15:18

6

Solved

I have a specialised case where I wish to serve a straight html file from a Controller Action. I want to serve it from a different folder other than the Views folder. The file is located in Solut...
Goniometer asked 31/5, 2012 at 8:46

3

I'm using rails_admin and I think it's great. Unfortunately I can't get to override a specific action on a specific model. I just need to override edit and update behavior on one model. Any idea? ...

4

Solved

I do this very often: <div id='Product'> @Html.Action("Create", "Product") </div> it's convenient because I can delegate the painting of a product creation form to another controller...
Verlie asked 2/7, 2011 at 3:38

3

I have a standard, non-async action like: [HttpPost] public JsonResult StartGeneratePdf(int id) { PdfGenerator.Current.GenerateAsync(id); return Json(null); } The idea being that I know this P...

7

Solved

I made a new action filter (attribute, similar to [Authorize]) which authorizes access to a controller action based on a session value. However, I'm basically decorating all my controller actions w...
Labrie asked 27/8, 2009 at 20:46

1

There are only two actions accessible in the ProductsController: # /config/routes.rb RailsApp::Application.routes.draw do resources :products, only: [:index, :show] end Tests are set up accordi...
Purpleness asked 21/8, 2013 at 12:26

2

Solved

I want to setup a custom nested controller actions but I can't figure out the routing. I keep getting the following error No route matches [GET] "/assets" routes.rb resources :companies do re...
Franctireur asked 30/6, 2012 at 9:32

2

Solved

I'm looking for a way to enforce a controller's action to be accessed only via an AJAX request. What is the best way to do this before the action method is called? I want to refactor the following...
Massotherapy asked 12/11, 2010 at 19:31

1

Solved

I am trying to secure a controller action to prevent a user from accessing an Entity that they do not have access to. I am able to do this with the following code. public ActionResult Entity(strin...
1

© 2022 - 2024 — McMap. All rights reserved.