User1520731567 posted
Hi shabbir_215,
I suggest you could use @Html.ValidationSummary.
You can judge in back end,check if Firstname and Lastname is empty in httppost action Upload.
And then add ModelState.AddModelError write custom error message,
Finally,pass error to @Html.ValidationSummary in the view.
For example:
public ActionResult Upload(FormCollection formCollection)
{
....
if(xxx)//Judging null
{
ModelState.AddModelError(string.Empty, "Firstname and Lastname are empty"); //Add error message if the condition is met
}
else
{
}
return View("Index");//this will jump to Index View
}
And then in Index View,add @Html.ValidationSummary,like:
...
<p>Index</p>
@Html.ValidationSummary(true, "", new { @class = "text-danger" })//this will receive error and display
...
Like the picture:

Best Regards.
Yuki Tao