Click here to Skip to main content
15,880,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everybody,

I am getting an Exception sometime. In my controller there is the same action with post is available. I am accessing this actionresult using Ajex Post Hit.

Exception: System.Web.HttpException (0x80004005): A public action method 'Search' was not found on controller


XML
Exception: System.Web.HttpException (0x80004005): A public action method 'Search' was not found on controller 'MyController'.
   at System.Web.Mvc.Controller.HandleUnknownAction(String actionName)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)    urlhttp://www.mydomain.com/My/Search/s/1?s=CA10    urlReferrerhttp://www.mydomain.com/Listing/s/2









Pls suggest me to solve this issue.
Posted
Updated 18-Jun-14 17:44pm
v2
Comments
DamithSL 18-Jun-14 22:27pm    
update question with your controller code
Prasad Avunoori 18-Jun-14 23:23pm    
Make sure your controller "Search" is public
Anubhava Dimri 18-Jun-14 23:24pm    
Yes It is..
_Asif_ 19-Jun-14 0:36am    
It seems that there is a problem in your routing. Check your routing.

1 solution

Actually i have the only post method in the controller. But some time the get request is getting. i do't know where from it coming. So in that case it is generating an error.

I have just placed here the Get verb with same ActionResult. Now it's working fine.


Thanks everybody.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900