@Html.LabelFor(model => model.ServiceTypeCode)</td>
 @Html.DropDownList("ServiceTypeId", new SelectList(ViewBag.ListServiceTypeClass, "ServiceTypeId", "ServiceTypeCode", Model.ServiceTypeId), "")

can anyone know how to do this.

If ServiceTypeCode = 'A1SG43'
{
@Html.EditorFor(model => model.StatutoryMaintenance)
}
else
{
@Html.EditorFor(model => model.CalloutDate)
}

How to achieve this please.

Recommended Answers

Can you be a bit more descriptive regarding your issue. The code above doesnt look like traditional ASP.NET, at least not Web Forms... maybe MVC?

Jump to Post

All 2 Replies

Can you be a bit more descriptive regarding your issue. The code above doesnt look like traditional ASP.NET, at least not Web Forms... maybe MVC?

Yes jorge it's MVC :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.