Not sure if this explanation is accurate, but this is how
i understand it...
With the html buttons, the OnClick works with the
javascript because the OnClick handles the click on the
client-side...if you look at the event handler for a html
button in your code-behind, you'll notice that the event
handled is actually ServerClick - the click is handled
server-side.
If you want to use a javascrupt function with the OnClick
for a web server button, you can either set it as a
property of the button in the aspx page like this:
OnClick="javascript
:MyFunction();"
Or you can add the javascript function to the web server
button's OnClick event in the code-behind like this
(working in vb):
btnName.Attributes.Add("onClick", "MyFunction();")
-----Original Message-----
With html buttons, I can say onclick="MyFunction();" and
it calls a JavaScript function called "MyFunction", but
with the Web Controls buttons, OnClick="MyFunction();"
produces an error:
Compiler Error Message: BC30456: 'MyFunction' is not a
member of 'ASP.wfNI206AE_aspx'. I'm trying to research
whthese controls can't find the javascript function. Both
the control and the javascript function are contained
within the same set of <form></form> tags.
Anyone know anything about this?
.