Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi to all,
i am having same view with two different names i.e ContactUs, Enquirenow. for ContactUs View having layout,other one is no. can i have single Action method for both views , if yes how should i call in Action method...
Posted

1 solution

yes it is possible. simply,


C#
public ActionResult(bool isRenderingContactUS = false)
{
//all your code here

//and just before returning
if(isRenderingContactUS)
{
return View("ContactUS"); 
}
else
{
return View("Enquirenow");
}
}
 
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