TechGuy
TechGuy

Reputation: 4570

Kendo Textbox enable / Disable according to multiple statuses

I have a kendo ui textbox and i need to enable / disable that control accoding to status.It works for 1 status but when i put another status with that it's not working

Control

Below one is working

  @Html.Kendo().TextBoxFor(model => model.NewsName).HtmlAttributes(new { @class = "form-control", required = "required" }).Enable(Model.NewsStatusId != 340)

When i put two status it's not working

@Html.Kendo().TextBoxFor(model => model.NewsName).HtmlAttributes(new { @class = "form-control", required = "required" }).Enable(Model.NewsStatusId != 340 || Model.NewsStatusId != 345)

How can i use it for two statuses ?

Upvotes: 0

Views: 1222

Answers (1)

Kei
Kei

Reputation: 1026

I think you meant to do

(Model.NewsStatusId != 340 && Model.NewsStatusId != 345)

instead of

(Model.NewsStatusId != 340 || Model.NewsStatusId != 345)

As written, your code will always evaluate to true.

Upvotes: 1

Related Questions