Server-side Javascript (aspx.cs) Attributes.Add Code to Change a Label's text

Posted by DFM on Stack Overflow See other posts from Stack Overflow or by DFM
Published on 2009-05-09T23:06:45Z Indexed on 2010/04/01 17:53 UTC
Read the original article Hit count: 222

Filed under:
|
|
|
|

I am trying to change a label's text by using server-side javascript (onclick) and C# within the page_load event. For example, I would like to write something like the following:

Label1.Attributes.Add("onclick", "Label2.text='new caption'")

Does anyone know the correct code for this? Also, what is this type of code referred to; is it just javascript or javascript in C# or is there a specific name? Lastly, does a book or online resource exist that lists the choices of control.attributes.add("event", "syntax") code to use with C#?

Thank you,

DFM

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about c#