Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Calling Javascript function

Reply
Thread Tools

Calling Javascript function

 
 
Krishna
Guest
Posts: n/a
 
      07-07-2003
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


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      07-07-2003
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:
http://www.velocityreviews.com/forums/(E-Mail Removed)

"Krishna" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      07-07-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
pat sinnott
Guest
Posts: n/a
 
      07-08-2003
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" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> 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
>>
>>

>
>
>.
>

 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      07-08-2003
?????

HTH,

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

"pat sinnott" <(E-Mail Removed)> wrote in message
news:89a401c34564$41ad7a00$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> >news:(E-Mail Removed)...
> >> 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
> >>
> >>

> >
> >
> >.
> >



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      07-09-2003
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" <(E-Mail Removed)> wrote in message
news:064401c3461c$fcf15990$(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> >news:89a401c34564$41ad7a00$(E-Mail Removed)...
> >> 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" <(E-Mail Removed)> wrote in message
> >> >news:(E-Mail Removed)...
> >> >> 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
> >> >>
> >> >>
> >> >
> >> >
> >> >.
> >> >

> >
> >
> >.
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
calling virtual function results in calling function of base class... Andreas Lagemann C++ 8 01-10-2005 11:03 PM
calling virtual function results in calling function of base class ... tiwy C++ 0 01-09-2005 11:17 PM
output text in control location; calling control javascript from page javascript Lisa Calla ASP .Net Building Controls 0 11-09-2004 02:17 AM
Calling a javascript function from server script URGENT HELP Silvia Brunet-Jones ASP .Net 1 07-28-2003 10:46 PM



Advertisments