Is it possible to call server side function from client side code in asp.net?

S

Simon

I heard that we could do that by using AJAX. Could anybody share how to do
it? Thanks.
 
S

Steven Cheng [MSFT]

Hi Simon,

For calling server-side function from page client(without postback),
ASP.NET 2.0 standard runtime has provided a feature called client script
callback. It require you to add some code to emit the script reference into
page's client. Here are some reference introducing this:

#Script Callbacks in ASP.NET 2.0
http://www.developer.com/net/asp/article.php/3485991

#Implementing Client Callbacks Programmatically Without Postbacks in
ASP.NET Web Pages
http://msdn2.microsoft.com/en-us/library/ms178208.aspx

Sure, ASP.NET ajax provide a more powerful framework that can help you call
server-side functions( static method in page or webservice) from client
script. If your application is ready to adopt AJAX framework, it's the
preferred choice. Here is a web video tutorial about calling server-side
functions from client:

#How Do I: Make Client-Side Network Callbacks with ASP.NET AJAX?
http://asp.net/learn/ajax-videos/video-79.aspx

you can find more information about ASP.NET ajax on the official site:

http://asp.net/ajax/

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.




--------------------
 
S

Steven Cheng [MSFT]

Thanks for your reply Simon,

If you have any further questions on this, welcome to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Reply-To: "Simon" <[email protected]>
From: "Simon" <[email protected]>
References: <[email protected]>
In-Reply-To: <#[email protected]>
Subject: Re: Is it possible to call server side function from client side code in asp.net?
Date: Wed, 30 Apr 2008 13:21:51 +0800
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top