Reputation: 11
How I could return a pop-up message that the search item is not existing? I have code below and it will just return a the heading portion on my table....
public ActionResult Index_PRFStatus(string searchBy, int id)
{
List<purchaseOrder> po = new List<purchaseOrder>();
po = db.purchaseOrders.ToList();
if (searchBy == "close")
{
if (id == null)
{
return HttpNotFound();
}
po = db.purchaseOrders.Where(x => x.prf_Id == id).Where(x => x.selected_supplier != null).ToList();
return View(po);
}
else
{
return View(po.ToList());
}
}
Upvotes: 1
Views: 327
Reputation: 1
Are you building your project in ASP.NET? If so, you cannot simply use MessageBox.Show. A better solution would maybe be to use javascript, like someone else implied.
Here's an example:
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "success", "alert('Could not be found'); {location.href='/Your.aspx';};", true);
Upvotes: 0