I have a submit button where I want to change the onclick method based on CurrentGroupName And I bring CurrentGroupName from ViewBag.
So here is the code if
CurrentGroupName = O&M Fiber Engineer I want onclick="return SaveFiberInfofttx('Approve');" method to enable.
And if
CurrentGroupName = O&M Fiber Lead I want onclick="return FiberLeadRejValidation_FTTX('Approve');" method to enable.
Here is my button code.
<input type="button" id="btnRemarksSubmitFLFTTX" class="button submit" value="@((ViewBag.CurrentGroupName == "O&M Fiber Lead") ? Html.Raw("Accept") : Html.Raw("Approve"))">
You can construct the required button attributes within a separate code block in the following manner:
Controller:
View: