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

Calling Javascript function

P: n/a
Hi all,

Can i call my javascript functions from the web controls.Any appropriate
site which will be tell more on this will be helpfull.

Regards..,
Krishna
Nov 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I have discussed about similar feature on ASP.NET Forums:
http://www.asp.net/Forums/ShowPost.a...&PostID=267756

--
Teemu Keiski
MCP, Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com

Email:
jo****@aspalliance.com

"Krishna" <gk*******@hotmail.com> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
Hi all,

Can i call my javascript functions from the web controls.Any appropriate
site which will be tell more on this will be helpfull.

Regards..,
Krishna

Nov 17 '05 #2

P: n/a
JavaScript executes on the client side. It is sent to the client as
scripting embedded in the HTML of a page. Therefore, you cannot interact
directly with JavaScript on the server side. You CAN, however, add
JavaScript to a page on the server, which will execute when the page loads
in the browser. You can do this by using the
Page.RegisterClientScriptBlock() and Page.RegisterStartupScript() methods.

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Some things just happen.
Everything else occurs.

"Krishna" <gk*******@hotmail.com> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
Hi all,

Can i call my javascript functions from the web controls.Any appropriate
site which will be tell more on this will be helpfull.

Regards..,
Krishna

Nov 17 '05 #3

P: n/a
Hi

I don't actually think it is this complicated.

You call use Javascript with server side controls exactly
as you use it with normal clientside HTML controls. There
are however a few caveats.

If the name of a server side event clashes with the name
of the client side event this will lead to a problem.
So for instance if you are programming javascript against
a webform button control you will need to use the
onMousedown client side event rather than the onclick
event as the there is an event named onclick on the server
side.

You will have no intellisense when you write the
javascript code against the server side controls as these
controls do not actually exist till they are rendered as
HTML when the application executes.
Also when referencing the control reference it as
document.all rather than document.Form1, I have sometimes
had problems with the latter syntax.

Regards,

Pat Sinnott MCSD

-----Original Message-----
JavaScript executes on the client side. It is sent to the client asscripting embedded in the HTML of a page. Therefore, you cannot interactdirectly with JavaScript on the server side. You CAN, however, addJavaScript to a page on the server, which will execute when the page loadsin the browser. You can do this by using the
Page.RegisterClientScriptBlock() and Page.RegisterStartupScript() methods.
HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Some things just happen.
Everything else occurs.

"Krishna" <gk*******@hotmail.com> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
Hi all,

Can i call my javascript functions from the web controls.Any appropriate site which will be tell more on this will be helpfull.

Regards..,
Krishna

.

Nov 17 '05 #4

P: n/a
?????

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Some things just happen.
Everything else occurs.

"pat sinnott" <pa*********@equitant.com> wrote in message
news:89****************************@phx.gbl...
Hi

I don't actually think it is this complicated.

You call use Javascript with server side controls exactly
as you use it with normal clientside HTML controls. There
are however a few caveats.

If the name of a server side event clashes with the name
of the client side event this will lead to a problem.
So for instance if you are programming javascript against
a webform button control you will need to use the
onMousedown client side event rather than the onclick
event as the there is an event named onclick on the server
side.

You will have no intellisense when you write the
javascript code against the server side controls as these
controls do not actually exist till they are rendered as
HTML when the application executes.
Also when referencing the control reference it as
document.all rather than document.Form1, I have sometimes
had problems with the latter syntax.

Regards,

Pat Sinnott MCSD

-----Original Message-----
JavaScript executes on the client side. It is sent to the

client as
scripting embedded in the HTML of a page. Therefore, you

cannot interact
directly with JavaScript on the server side. You CAN,

however, add
JavaScript to a page on the server, which will execute

when the page loads
in the browser. You can do this by using the
Page.RegisterClientScriptBlock() and

Page.RegisterStartupScript() methods.

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Some things just happen.
Everything else occurs.

"Krishna" <gk*******@hotmail.com> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
Hi all,

Can i call my javascript functions from the web controls.Any appropriate site which will be tell more on this will be helpfull.

Regards..,
Krishna

.

Nov 17 '05 #5

P: n/a
Thanks Pat! You had me lost there!

Kevin Spencer
..Net Developer
Microsoft MVP
http://www.takempis.com
Big things are made up
of lots of little things

"Pat Sinnott" <Pa*********@equitant.com> wrote in message
news:06****************************@phx.gbl...
Hi Kevin

Sorry I thought the query related to calling javascript
functions from the HTML representation of the server
control.

Pat.
-----Original Message-----
?????

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Some things just happen.
Everything else occurs.

"pat sinnott" <pa*********@equitant.com> wrote in message
news:89****************************@phx.gbl...
Hi

I don't actually think it is this complicated.

You call use Javascript with server side controls exactly as you use it with normal clientside HTML controls. There are however a few caveats.

If the name of a server side event clashes with the name
of the client side event this will lead to a problem.
So for instance if you are programming javascript against a webform button control you will need to use the
onMousedown client side event rather than the onclick
event as the there is an event named onclick on the server side.

You will have no intellisense when you write the
javascript code against the server side controls as these controls do not actually exist till they are rendered as
HTML when the application executes.
Also when referencing the control reference it as
document.all rather than document.Form1, I have sometimes had problems with the latter syntax.

Regards,

Pat Sinnott MCSD
>-----Original Message-----
>JavaScript executes on the client side. It is sent to the client as
>scripting embedded in the HTML of a page. Therefore, you cannot interact
>directly with JavaScript on the server side. You CAN,
however, add
>JavaScript to a page on the server, which will execute
when the page loads
>in the browser. You can do this by using the
>Page.RegisterClientScriptBlock() and
Page.RegisterStartupScript() methods.
>
>HTH,
>
>Kevin Spencer
>Microsoft FrontPage MVP
>Internet Developer
>http://www.takempis.com
>Some things just happen.
>Everything else occurs.
>
>"Krishna" <gk*******@hotmail.com> wrote in message
>news:uf**************@TK2MSFTNGP12.phx.gbl...
>> Hi all,
>>
>> Can i call my javascript functions from the web
controls.Any appropriate
>> site which will be tell more on this will be helpfull. >>
>> Regards..,
>> Krishna
>>
>>
>
>
>.
>

.

Nov 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.