hi
below code is my view am trying to add required field validator in red color on text-boxes( txtValue, txtLocation)..
Note:
#1 ) i have set if condition in this view that you can see below.
#2 ) textboxes are called in ID
@using (Html.BeginForm())
{
}
@if (ViewBag.Message == true)
{
}
else
{
if (Model != null)
{
if (Model.Count() != 0)
{
Searched for "@Session["searched"]"
@foreach (var item in Model)
{
@item.BusinessName
@item.FirstName
@item.BusinessCategory

Map
ZipCode
@item.ZipCode
@Html.ActionLink("Book An Appointment", "CalendarView", "Appt", new { id = @item.UserID }, null)
@*@Html.ActionLink("Book An Appointment", "Popup", "Search", new { @class = "openDialog", data_dialog_id = "aboutlDialog", data_dialog_title = "Additinal Customer" })*@
}
}
else
{
}
}
}
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Rajeesh MenothRank #118 · 18.4K reputationPosted Aug 24, 2015, 2:01 AM EDT
Ruga Lincy35 reputationPosted Aug 24, 2015, 2:05 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Aug 24, 2015, 2:12 AM EDT