1

I have a button and a label. on clicking on that button i want to change the text of label. How can i do this in Asp.net mvc 1.0.

4
  • Do you want this to be changed client-side or server side? Where is the data coming from? Commented Aug 10, 2010 at 8:39
  • i want to do this in server side. Commented Aug 10, 2010 at 8:44
  • Do you have <asp:Label id="Label1" runat="server"/> and <asp:Button id="Button1" runat="server" /> or you have an <input type="submit" /> and <span>? Commented Aug 10, 2010 at 8:46
  • 2
    you should check out the videos over at www.asp.net/mvc for an introduction to basic MVC.. Best place to start! MVC does not behave the way one is used to from Webforms. Commented Aug 10, 2010 at 8:47

1 Answer 1

1

Unlike in ASP.NET Webforms, there are no events in ASP.NET MVC!

You could use HtmlHelper.ActionLink to create a link to the current view with a parameter containing the new label text.

For simple things that don't really deserve a parameter I would simply use JavaScript though.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.