Tuesday 16 February 2021

MVC - Fix Erro - Cannot implicitly convert type 'void' to 'System.Web.Mvc.ActionResult'

Watch this example on YouTube

 

 

Cannot implicitly convert type 'void' to 'System.Web.Mvc.ActionResult'   
 

To fix it replace

   public ActionvoResult DoSomething()
        {
            return CallSomeFunction();
        }

        public void CallSomeFunction( )
        {
            //do nothing
        }

with 


        public void DoSomething()
        {
             CallSomeFunction();
        }

        public void CallSomeFunction( )
        {
            //do nothing
        }

No comments:

Post a Comment