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
//from the code behind function
label1.Text="new text";
Can some one please check and help me to resolve the issue?
Tahir AnsariPosted Aug 16, 2023, 1:17 PM
AnuPosted Aug 16, 2023, 1:54 PM
Thanks, it worked
AnuPosted Aug 16, 2023, 1:12 PM
Thanks for your reply, the method which you suggest will work in ach page load, but in my case the action method with get involked each time when I am changing the selection in the dropdown. At the same time I want to show the updated text in the label also.
Tahir AnsariPosted Aug 16, 2023, 1:05 PM
If you are using asp.net mvc
Your view