473,387 Members | 1,517 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,387 software developers and data experts.

Calling server side function in javascript (ASP.Net 2.0)

KK
Hi,

Does anybody know how to call server side function in javascript?

Suppose I've a method named Test() at code behind of ASP.Net page.

How can I call that method in javascript function ???

Any help is appreciated..

Thanks
Crystal
Apr 21 '06 #1
4 12402
You have to have the script repost to the page and put a query string
in that triggers the method. Thats the only way I know of, as js is
client side. Alternatively you could have an empty aspx page that the
js calls which runs your code and then redirects back to the page.
Then you could store any variables you want in seession variables...its
up to you.

Apr 21 '06 #2
Try AJAX. I think thats what its all about and will work better than
the other solution you have from Phuff.

KK wrote:
Hi,

Does anybody know how to call server side function in javascript?

Suppose I've a method named Test() at code behind of ASP.Net page.

How can I call that method in javascript function ???

Any help is appreciated..

Thanks
Crystal


Apr 21 '06 #3
"Phuff" <pc*****@gmail.com> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...
You have to have the script repost to the page and put a query string
in that triggers the method. Thats the only way I know of, as js is
client side. Alternatively you could have an empty aspx page that the
js calls which runs your code and then redirects back to the page.
Then you could store any variables you want in seession variables...its
up to you.


Don't even attempt this - use Ajax, that's what it's for.
Apr 21 '06 #4
NH
check out Atlas (http://atlas.asp.net)
This is Microsofts Ajax framework, its easy to use.

"ta****@gmail.com" wrote:
Try AJAX. I think thats what its all about and will work better than
the other solution you have from Phuff.

KK wrote:
Hi,

Does anybody know how to call server side function in javascript?

Suppose I've a method named Test() at code behind of ASP.Net page.

How can I call that method in javascript function ???

Any help is appreciated..

Thanks
Crystal


Apr 21 '06 #5

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...
2
by: Sehboo | last post by:
How can I call asp function from javascript?
5
by: Krishna | last post by:
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
4
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is...
1
by: Jim Hammond | last post by:
The following code uses a client-side component to capture an image from the camera on the client system. The problem is that the init function (in ClientSideAssembly_Video.dll) is called once...
6
by: Guadala Harry | last post by:
I have some client-side JavaScript that, among other things, calculates the value of a variable (myVar). On the server I have a stored procedure that needs to somehow receive as an input parameter...
7
by: Roger | last post by:
Is this possible?? client side: <script language="jscript"> function hello() { window.alert("HELLO!"); } </script>
10
by: Bishoy George | last post by:
// I wrote the following code but it is not working. // Any help please? // ------------------------------------------------ using System; using System.Collections; using System.ComponentModel;...
6
by: den 2005 | last post by:
Hi everybody, Question 1: How do you set the values from server-side to a client-side control or how do you execute a javascript function without a button click event? Question 2: How do you...
4
by: Erland | last post by:
Hello everyone, I am have couple of bad concepts and would like to clear things up. As I understand ASP.NET server controls contain runat=server tag and they only run on the server. But I've...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.