Web Control On... Event

  • Thread starter Thread starter C CORDON
  • Start date Start date
C

C CORDON

I wonder if those events that controls show on HTML code On... can be bound
to a Javascript, if not...what use is there to them. If they can call
JavaScripts how is this done because I am gettong this error when adding
OnCheckedChanged="get()" to a checkbox.

'get' is not a member of 'ASP.Anuncio_aspx'

TIA
 
Hi,

You need to add an attribute to your check box in your code behind. For
example in the page load enter this:

chkBoxName.Attributes.Add("onClick", "get();");

That will run your javascript get(); function when the user clicks the check
box. In that routine you would then test to see whether the check box is
checked or not and run the appropriate code. Good luck! Ken.
 
Back
Top