Linked Questions

0 votes
1 answer
2k views

I have this simple class inside my ASP.NET MVC 3 application: namespace My.Project.Controllers { public ActionResult Settings() { var m = GetUserData(userID); ... } ...
Glenn Utter's user avatar
  • 2,363
18 votes
3 answers
155k views

On my MVC View I have button: <input id="btnSave" type="submit" name="Save" value="Save" /> When I click this button I need call one Action, do some stuff there and then Submit my form. I have ...
Bryuk's user avatar
  • 3,345
4 votes
4 answers
14k views

i have an object "ApplicantDetail" with list of objects in ApplicantController and i want to send Post Request to Personaldetails Api On To save into database and get response back Api On ...
Alpha977's user avatar
1 vote
3 answers
7k views

I want to reuse my razor pages instead of having multiple similar views in mvc, I don't want to use a partial view. Thus I want to pass a parameter from a controller to razor page. In the razor page ...
Gino's user avatar
  • 39
3 votes
1 answer
4k views

I want to call a controller method from a class and get the controller context without making requests to the controller. What are possible ways of doing that? I can call method by creating an object ...
Ali Hussain's user avatar
0 votes
1 answer
4k views

I am thinking about a scenario rather similar to this question asked some time ago: How to call another controller Action From a controller in Mvc In the scenario I am thinking of, controller B would ...
CJS's user avatar
  • 88
1 vote
1 answer
2k views

I have a put method in controller A where i pass in json object and do some checks in dynamo db, based on my output [HttpPut] public async Task<IActionResult> ProcessEmployee([FromBody]...
user2950716's user avatar
2 votes
0 answers
2k views

I can't believe I cannot find any solution to this. For business reason, RedirectToAction or anything won't do because it causes a HTTP 302 to be returned. An example: public async Task<...
Luke Vo's user avatar
  • 21.6k
2 votes
1 answer
1k views

I am having two controller. 1st controller having parameterized constructor and some methods. Now I have to call that methods in my another controller. is there any way to do it? Below is code ...
Jatin Gadhiya's user avatar
-1 votes
1 answer
428 views

I am calling KitchenController from HomeController, how can I get KitchenController's Model in HomeController. public void KichenDetails(string KichenId) { if (string....
Sunil Chaudhary's user avatar
0 votes
1 answer
325 views

I am working Asp.Net Core. I need to call the action method from one controller to another. I tried by using the RedirectToAction method. When I am using this, I get an error like "No route matched ...
Nivitha Gopalakrishnan's user avatar
1 vote
0 answers
358 views

I'm working on upgrade of our WebAPI and have an issue - how to execute the controller action from my code. I checked following question: how to call another controller action from a controller in ...
user3875682's user avatar
1 vote
2 answers
237 views

I am trying to set role to the logged user but I can't get the logged user name in my non-action method called from another controller. I am missing something, because I get the error: "Object ...
Dan Romulus's user avatar
0 votes
1 answer
313 views

I am rusty in ASP.Net MVC and am struggling with the proper way to resolve a situation I have ran into on a large project that I inherited. The application has a large number of controllers that were ...
Mark1270287's user avatar
0 votes
1 answer
204 views

I am working on a MVC.NET project. I have some question about this technology. I have some functions ( or actions ) which are common between controllers. One of the ways to have shared function among ...
Behzad Hassani's user avatar

15 30 50 per page