By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,101 Members | 1,360 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,101 IT Pros & Developers. It's quick & easy.

onclick

P: n/a
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 wh
these 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?

Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
did you write a JavaScript function 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?

.

Jul 19 '05 #2

P: n/a
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?

.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.