I want to display a string message through a string variable by passing from controller to View.
Here is my controller code:
public ActionResult SearchProduct(string SearchString)
{
FlipcartDBContextEntities db = new FlipcartDBContextEntities();
string noResult="Search Result Not Found";
var products = from p in db.Products select p;
if (!String.IsNullOrEmpty(SearchString))
{
products = products.Where(s => s.ProductName.StartsWith(SearchString));
return View(products);
}
else
{
return View(noResult);
}
// Here i want to display the string value ei Message to the view.
please guide me. Am new to MVC