M
M
mindgrow2018-02-18 17:24:51
ASP.NET
mindgrow, 2018-02-18 17:24:51

ASP MVC how to add condition for div block attribute substitution?

Good afternoon.
View displays a list of events. A div block is created for each event on the View. Depending on the status of the event, the color of the block should be different. How to implement a select condition to populate a div attribute?
It is necessary that, depending on the status, the class attribute is filled

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mindgrow, 2018-02-18
@mindgrow

I created a Dictionary, which I pass to the ViewBag, and then to the View, in the attribute I fill in the class through the format string

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question