Calling C# function through Javascript in ASP.NET

Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Aug 2005
Posts: 1
Reputation: SushilKumar is an unknown quantity at this point 
Solved Threads: 0
SushilKumar's Avatar
SushilKumar SushilKumar is offline Offline
Newbie Poster

Calling C# function through Javascript in ASP.NET

 
0
  #1
Aug 24th, 2005
Hi Guys,

Is it possible to call the C# function from Javasript......

Sushil Kumar :rolleyes:
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Calling C# function through Javascript in ASP.NET

 
0
  #2
Aug 24th, 2005
Not directly, no. Server-side functions live server-side, client-side functions live on the client.

In fact, the only way to get ANY server-side code to run, is to submit the form. ASP.NET unrolls the HTTP headers, unpackages the hidden ViewState variable, re-instantiates objects, and then decides what events to raise based on all of the above.

What you can do is have your JavaScript function set a hidden form variable, then do a form.submit().

Then, in your Page_Load handler on the server, use the Request object to check for the presence and/or value of this variable, and call the appropriate server-side method.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 118
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: Calling C# function through Javascript in ASP.NET

 
0
  #3
Feb 25th, 2008
Originally Posted by SushilKumar View Post
Hi Guys,

Is it possible to call the C# function from Javasript......

Sushil Kumar :rolleyes:
Yes it is possible to call C# function through javascript using Ajax extensions in Asp.Net
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Calling C# function through Javascript in ASP.NET

 
0
  #4
Feb 25th, 2008
You're a little late serk..

Aug 24th, 2005
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1
Reputation: farrukhiftikhar is an unknown quantity at this point 
Solved Threads: 0
farrukhiftikhar farrukhiftikhar is offline Offline
Newbie Poster

Re: Calling C# function through Javascript in ASP.NET

 
0
  #5
Jan 16th, 2009
you can do this.
please visit this article . i thing it would be help full to you.
http://sappidireddy.wordpress.com/20...n-aspnet-ajax/
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 1
Reputation: binbotboo is an unknown quantity at this point 
Solved Threads: 0
binbotboo binbotboo is offline Offline
Newbie Poster
 
0
  #6
12 Days Ago
Just a quick thought here. Vfp programmer learning C#, .net, etc. Even with the time differences on the post I found it really helpfull on my learning curve. Thanks guys!!!
Oct 27, 3009!
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 200
Reputation: carobee is an unknown quantity at this point 
Solved Threads: 11
carobee carobee is offline Offline
Posting Whiz in Training
 
0
  #7
12 Days Ago
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,780
Reputation: ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all 
Solved Threads: 113
ithelp's Avatar
ithelp ithelp is offline Offline
Posting Virtuoso
 
-1
  #8
12 Days Ago
Originally Posted by binbotboo View Post
Just a quick thought here. Vfp programmer learning C#, .net, etc. Even with the time differences on the post I found it really helpfull on my learning curve. Thanks guys!!!
Oct 27, 3009!
Attention Dani ! We have got an alien from future in this board.
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC