Click here to Skip to main content
15,898,770 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends plz guide me

i have a function like this
public JsonResult test()
{
  if(1)
   {
return RedirectToAction("actionmethod","controllename");//this is not working

   }
  else
  {
  return json();
   }

}


i want to redirect to another view from this method
Posted
Comments
m19anand 1-Feb-12 9:11am    
Hai boss,... i too have same problem now, can u please share ur solution with me,.. how to return to a view from a Json Method??

1 solution

You need to return the more generic 'ActionResult', which a redirect to result and a json result both derive from.
 
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