Anu

Anu

  • 1.5k
  • 205
  • 9.4k

updating the label text from controller's action method

Aug 16 2023 12:55 PM

Hi,

I have a label used in my view page as below

@Html.Label("label1")

 I want to change the text of a label from the controller's action method. It shoud be something like the below code which we can set in the asp.net webform

<asp:label id="label1" runat="server"/>

//from the code behind function

label1.Text="new text";

 Can some one please check and help me to resolve the issue?


Answers (4)