2 Replies - 166 Views - Last Post: 11 September 2019 - 11:33 AM Rate Topic: -----

#1 ahmedba   User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 220
  • Joined: 24-January 14

How to call actionresult on another actionresult on asp.net core 2.2 ?

Posted 11 September 2019 - 04:53 AM

Problem

How to call ActionResult on another ActionResult ?

I have two ActionResult PostUserLogins and ActionResult GetBranches

Can I call ActionResult getbranches inside ActionResult PostUserLogins ?

[
HttpPost(Contracts.ApiRoutes.Login.UserLogin)]
        public IActionResult PostUserLogins([FromBody] Users user)
        {
// call action result to get  GetBranches(Users user) as json;
        }
 [HttpGet(Contracts.ApiRoutes.Login.GetBranches)]
        public IActionResult GetBranches([FromBody] Users user)
        {
// here return json 
        }


Is This A Good Question/Topic? 0
  • +

Replies To: How to call actionresult on another actionresult on asp.net core 2.2 ?

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15357
  • View blog
  • Posts: 61,571
  • Joined: 12-June 08

Re: How to call actionresult on another actionresult on asp.net core 2.2 ?

Posted 11 September 2019 - 06:49 AM

Are you expecting to navigate to that function, or just get the results?
Was This Post Helpful? 0
  • +
  • -

#3 DarenR   User is offline

  • D.I.C Lover

Reputation: 634
  • View blog
  • Posts: 4,218
  • Joined: 12-January 10

Re: How to call actionresult on another actionresult on asp.net core 2.2 ?

Posted 11 September 2019 - 11:33 AM

i think the best way is to create a main result with partial results which will give you all the action results you want
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1