In the controller, the action puts the dynamic readOnly property in the ViewBag
public ActionResult Search() { ViewBag.readOnly = false; return View("Search"); } In the very view of the code:
<%if (!ViewBag.readOnly) {%> <div id="CenterButtonsBlock"> <input type="button" class="k-button" id="AddSelectedDonors" value="Добавить в реестр почетных доноров"/> </div> <%}%> Those. it is assumed that the value is false, then the button should be shown. If true, the button should not be. In fact, the button is always visible.