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

Calling a function in codebehind from the html side of the aspx?

P: n/a
I read from some book that you can actually on any tag in the html page put
a onClick or something and assign it with the sub/function name that is in
the codebehind. I tried but it say name undefined.

I am trying to make a rollover effect using codebehind. I have a <a> tag
that onmouseover will call a sub in codebehind to change a <asp:image> image
url.

How come i can see a lot of "on" events of the <a> in the html side but when
i declare it in the codebehind and i can only access only a few of them?

thanks.
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
It seems you misinterpreted the book that you read.

You don't want the page to post back every time the mouse moves over an
image. The performance would be terrible.

You want to call client side code such as javascript to do this, not your
code behind. And yes, you would use the (client side) onMouseOver event to
call your javascript function.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"exshige" <ex*****@yahoo.no.spam.com> wrote in message
news:3f**********@news.tm.net.my...
I read from some book that you can actually on any tag in the html page put a onClick or something and assign it with the sub/function name that is in
the codebehind. I tried but it say name undefined.

I am trying to make a rollover effect using codebehind. I have a <a> tag
that onmouseover will call a sub in codebehind to change a <asp:image> image url.

How come i can see a lot of "on" events of the <a> in the html side but when i declare it in the codebehind and i can only access only a few of them?

thanks.

Nov 17 '05 #2

P: n/a
hmm.. thanks.. i actually did thought of using js to do that like the old
days.. but again, i thought maybe i could create something that is totally
vb based... i tried to put the code from codebehind together with the html
page under the script tag but it won't let me reference to other controls on
the page inside that sub or function.

i get what u mean.. well, i guess i have no choice but to use js.

thanks.
"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:#X**************@TK2MSFTNGP10.phx.gbl...
It seems you misinterpreted the book that you read.

You don't want the page to post back every time the mouse moves over an
image. The performance would be terrible.

You want to call client side code such as javascript to do this, not your
code behind. And yes, you would use the (client side) onMouseOver event to call your javascript function.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"exshige" <ex*****@yahoo.no.spam.com> wrote in message
news:3f**********@news.tm.net.my...
I read from some book that you can actually on any tag in the html page

put
a onClick or something and assign it with the sub/function name that is in the codebehind. I tried but it say name undefined.

I am trying to make a rollover effect using codebehind. I have a <a> tag
that onmouseover will call a sub in codebehind to change a <asp:image>

image
url.

How come i can see a lot of "on" events of the <a> in the html side but

when
i declare it in the codebehind and i can only access only a few of them?
thanks.


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.