473,409 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Calling Javascript function

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
5 51467
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
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
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
?????

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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: R.G. Vervoort | last post by:
I am using a javafunction (onclick in select) in which i am calling a function in php (thats why i send this to both php and javascript newsgroups). in the onclick i call the function...
18
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes...
4
by: Martin Feuersteiner | last post by:
Dear Group I'm using VB to write an aspnet application. I would like to call a javascript function from within a VB Sub or VB Function, is it possible? My code is something like this: VB...
13
by: ukrbend | last post by:
I'm new to Javascript and to html and am trying to make the following code snippet work but it doesn't. It refuses to call the getPage() function and I always get a 404 error. I know the code is...
4
by: Adam Smith | last post by:
Hello, How can I call or trigger an external javascript twice in a form? I have <script language="JavaScript" src="country_state.js" name="Country_State"> <script type="text/javascript"...
6
by: Ajit Goel | last post by:
Hi; We have a Javascript function which I have been tasked to move to a CSharp class. This javascript function uses Regular expression extensively. This function has a string input parameter and...
2
by: moni | last post by:
Hi, I wanted to call a javascript function function showAddress(address) { ..... } from the aspx.cs file from the Gridview_RowCommand function
1
by: Memphis Steve | last post by:
Is it possible to combine multiple javascipts into one file and then call that file from a linked URL in the head section of an XHTML file? Here are the two scripts I want to use with the...
15
by: Sampat | last post by:
Hi, I wanted to know the performance of calling a function pointer v/s a normal function call in javascript in a scenario where there are multiple calls in the js to the same function. Please...
9
by: mrcheeky | last post by:
Hi, I'm stuck, but it's almost working! From a html page, my javascript calls a server-side php script. The php reads a value from a server-side .txt file and passes it back as a javascript...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.