jScript call from the code-behind (aspx.cs)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does someone know if it is possible do call a jScript-function from the
code-behind (aspx.cs)?
For exemple

// in the aspx.cs
this.ImageButton1.Attributes.Add("onClick","ShowPic(43);");


//and then in the HTML-code of this side:
function ShowPic(int x)
{
how ever
}

Thanks a lot for every answer
Patrick Marti
 
Hi Patrick,

Yup, try it--you can do it exactly as you suggested. Add the button
attribute on Page.Load().

- Mike
 
Back
Top