adding webcontrol button attributes

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

Guest

how can I call javascript function by adding button's attribute such as "onclick" in the code behind file as ".aspx.vb"

I have written code as Draw_line.Attributes("Onclick")="javascript:

where DrawLine is the name of the button

please help me
 
Hi,

The correct sintax is:

DrawLine.Attributes.Add("OnClick", "javascript:myCode");

HTH,
Stefano Mostarda MCP
Rome Italy
 
Back
Top