Calling Server Side VB.NET code with Javascript just to call a sub method

Hi,

Can anyone please give me a clue on how to call my Server side  CalculateResult() method from Javascript code when onchange event is fired??

 thanks in Advance

Dollarjunkie


.Net Web/Software Engineer
0
Dollarjunkie
11/2/2007 5:00:22 PM
asp.net.client-side 24353 articles. 2 followers. Follow

5 Replies
1354 Views

Similar Articles

[PageSpeed] 19

You will have to use AJAX.  Is there any reason why the CalculateResult logic cannot be handled by Javascript?

Best regards...


Josh Stodola ← Come check out my blog!
0
JoshStodola
11/2/2007 5:20:04 PM

The reason is this... I need to have the code go get information based on what is retrieved and then do some calculations based on that and then display the information in one of my controls. I am not really Javascript savvy so I prefer to use as little of it as I have to. Problem in my case is I have no idea how to simply use it to call a server side code. I do not know how to go about doing this with Ajax either. All I want to do is catch that event when it is fired from the client side.

 


.Net Web/Software Engineer
0
Dollarjunkie
11/2/2007 5:25:54 PM

Dollarjunkie:
All I want to do is...

I hate it when a developer starts a sentence like this.  You probably would also like a big "Do It" button on your desktop.  Keep dreaming, it's not going to happen.

Having javascript call server-side is not the easiest of tasks.  There are many things to consider.  ASP.NET makes it rather simple with their client callbacks, though.  Check out the links below...

    http://www.dotnetjunkies.com/Article/E80EC96F-1C32-4855-85AE-9E30EECF13D7.dcik

    http://msdn2.microsoft.com/en-us/library/ms178208.aspx

    http://www.codeproject.com/aspnet/ClientCallBackAspNet2.asp


Hope this helps!  Please mark the helpful post(s) as Answer.


Josh Stodola ← Come check out my blog!
0
JoshStodola
11/2/2007 7:19:33 PM

JoshStodola:

Dollarjunkie:
All I want to do is...

I hate it when a developer starts a sentence like this.  You probably would also like a big "Do It" button on your desktop.  Keep dreaming, it's not going to happen.

Having javascript call server-side is not the easiest of tasks.  There are many things to consider.  ASP.NET makes it rather simple with their client callbacks, though.  Check out the links below...

    http://www.dotnetjunkies.com/Article/E80EC96F-1C32-4855-85AE-9E30EECF13D7.dcik

    http://msdn2.microsoft.com/en-us/library/ms178208.aspx

    http://www.codeproject.com/aspnet/ClientCallBackAspNet2.asp


Hope this helps!  Please mark the helpful post(s) as Answer.

 

 

The Mdsn turned out to be exactly what I needed... thanks....


.Net Web/Software Engineer
0
Dollarjunkie
11/2/2007 11:25:32 PM

Glad you got it figured out!!  Why would you mark your post as Answer instead of mine?

Best regards...


Josh Stodola ← Come check out my blog!
0
JoshStodola
11/3/2007 12:09:32 AM
Reply:

Similar Artilces:

Call Server Side methods from Client Side
Hi, How to call Server Side methods from ClientSide with results back. Earlier we were using Anthem approach but now want to use some thing with AJAX. Thanks in Advance.  RegardsSreenivas. you can use the page methods of the ClientScript  control ,please read  : http://aspalliance.com/1294_CodeSnip_Handle_Browser_Close_Event_on_the_ServerSide Regards,Anas Ghanem.Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on the forums (like duplicate ,Off-topic,offensive,or any post that violates the website "TERMS OF USE...

Calling server-side code from client-side
Hi,  I´m implementing some shortcut functionality in my web forms and wanna know where i can find something that explains, for example, how to call the handler event "onclick" of a button. I´m using this library to add shortcuts to my controls: http://www.openjs.com/scripts/events/keyboard_shortcuts/   And I want to "link" some key combination for the event handlers of the controls. Does anybody knows?  Thanks. You could attach an AJAX event to the Javascript shortcut event handler so, for example, the shortcut function will trigger a button cl...

Call server side method from client side...
I'm using Jquery to call a modal popup dialog and depend on what user select i nead to call a method to populate my generic list can that be don or is no posible way to do that...     Sorry for my bad english...Florim Maxhuni  If you need to call the server from the clientside, you need to look into Ajax Eric Pascarello.com | Twitter epascarello | LinkedIn...

Is it possible to call client side function from server side code without initial client request?
Atlas is great. I'm using timer to periodically check database changes on server to populate client side controls with new data. Is it possible to do it without a lot of client requests to server which takes a huge useless network traffic? Server should call client side function on all connected clients when, for example, 'database updated' event occurs on server. Thanks. Hi~ Just for your interest, I think you could have a look at Comet, many web IM like Gmail's embeded Gtalk and meebo.com are built on this architecture你好! Just FYI o_O...

call server side funciton from client side code.
how can i call a server side fuction which is a button click event "btnSave_click(object serder, EventArgs e) " from java script function ? there is an ifram on a master page, the javascript.js file is included on master page while the page that has function btnSave_click(object serder, EventArgs e) is loaded in iframe.  you just can'tasp.net is server side technologies and javascript a client side technologies the only way for the server to know what's happening on the client is to posback the page for instancethey are workaround to do thischeck out this post,...

Problem call a server-side code from Client-side
Hi; I want to call a server-side code from client-Side at javascript function. must me use from Ajax or Http Requests in Javascript?   Thanks,mohsen  You'll have to make an AJAX call form your client side to acheive thisRegards,Muhammed Saleem P---------------------------------------------Please do not forget to click "Mark As Answer" on the posts that helped you.Happy Programming !!! I answered a question with sample code very similar to this one here: http://forums.asp.net/p/1358277/2799269.aspx#2799269 NC...  ...

Call a Sever side method from Client Side Javascript.
Hi Friends,  Can you tell me how can i call a Server Side method of mine from Javascript?   function StoreURL() { document.getElementbyId(METHODNAME); } Is this the correct method? Any suggestions would be appreicated. Thanks Menon  hi!document.getElementById allow you to access elements from html page  DOM in client side.to call server method from client you have to use  AJAX see this example and read this tutorial.hope it helpsorzeh code less, think more! Or do a PostBack: /////////////////////////////////// Client-side code/////////////////////////...

Calling server-side methods from client-side event
Hello,i'm novice in asp.net client-side script and i have a simple question: is it possibile to call a server-side method (ex. c# managed code) from a java script client-side function linked to an event?Thanks all  Luca GuccioneGenova, Italy Yes you can. It's very easy using web methods from code behind, jquery and the script manager. See this very good blog post explaining the steps: http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/ mySoZa lucaguccione: Hello, i'm novice in asp.net client-side script and i have a simple quest...

How to call server side function from client side JavaScript?
I want to call a server-side function, like a button's click event or just another private or public function , from a client-side JavaScript function. How do I do that? thanX AnzIf this post was useful to you, please mark it as answer.ClientSideAsp.Net | Blog Maybe alittle more that you need, but....... 1) Put a button on the page. Lets say its id is Button1. Make sure that its has causesValidation=false 2) Write the code for the button. 3) Write the following in the PAge_Load event Button1.Attributes.Add("onClick", "myJSFunction(); return false") 4) Copy this javascript...

Call server side function from client side javascript
I have a javascript where I either need to call an onclick even of a server link button or I need to be able to call a server side function.   The only thing is I cant use AJAX.  Is there any way I can do this or am I spinning my wheels. Thanks!-------------Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue. I have a similar problem.  In my case, I would like to set a server-side session object from JavaScript.  Any suggestions?  Thanks.  Dan Sure, y...

how to call server side function from client side javascript?
Hi all, I have a image button in the update panel. I would like to call a method from server side (not from webservice) to get the variable when Onclick on the image button is invoked. Is there any way that I can able to access this function from the client script? In using the UpdatePanel, in essence, you're already doing this because there will not be a full postback.  You can make an asynchronous call to your Click method of your ImageButton.  So, what do you want to do with this "variable"?Christopher Reed"The oxen are slow, but the earth is patient."...

Call client side function from server side code
My problem is that in some point of the VB.Net code I need to call a function defined in vbScript, for example: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click   'There's some code here....   ' ...   If (SomeCondition) Then   'HERE'S WHERE I NEED TO CALL THE JAVASCRIPT FUNCTION... SO HOW CAN I DO THAT?   Else     '...   End If   ' ... End Sub The asp.net code runs to generate the html and when it is done the html is rendered in your browser. So you can't access cli...

Calling server side sub from client side button click
Hi, I have some javascript in my asp.net page, and a function within that, which is run when the client side form is submitted. What I need is for that function to run, which updates a server side variable, then following that a server side sub should run, using that (newly updated) variable. I have currently set it up with the  onsubmit= tag of the client side form running the first (JavaScript) function, and then the submit button at the bottom of the client side form calling the server side sub with its onClick property. The (probably quite daft!) thinking behind that was that the on...

Can you call a c# on the server side from javascript functions on client side
Hello guys This is something intresting I have come across during development. I have a javascript written in a .JS file , to my knowledge the .js files are executed on the server side. But security concerns with java script that these .js files can be access by connecting to port 80 of the server . So an ultimate alternative reminas to call c# code from a java script function. Can anyone Help me on this matter Regards Nihar Hi Nihar, Usually .js files executed on client side. Please explain your configuration.Leon LangleybenMCSD, ASP.NET MVPBlog...

Web resources about - Calling Server Side VB.NET code with Javascript just to call a sub method - asp.net.client-side

JavaScript Kit- Your comprehensive JavaScript, DHTML, CSS, and Ajax stop
Your comprehensive JavaScript, DHTML, CSS, and Ajax stop

Let's Code: Test-Driven Javascript by James Shore — Kickstarter
James Shore is raising funds for Let's Code: Test-Driven Javascript on Kickstarter! A screencast series focusing on rigorous, professional Javascript ...

Eloquent JavaScript: A Modern Introduction to Programming
... and pragmatics. I loved the tutorial-style game-like program development. This book rekindled my earliest joys of programming. Plus, JavaScript! ...

JavaScript - Wikipedia, the free encyclopedia
programming styles. JavaScript was formalized in the ECMAScript language standard and is primarily used in the form of client-side JavaScript ...

Open Directory - Computers: Programming: Languages: JavaScript: Tools: Obfuscators
... editor - report abuse/spam - help the entire directory only in Tools/Obfuscators Description Top : Computers : Programming : Languages : JavaScript ...

Facebook File-Transfer App Pipe Relaunches, Now Works Via JavaScript, WebRTC
... allowed Facebook users to send and receive files up to 1 gigabit in size. A new version of Pipe debuted Monday, and the app now works via JavaScript ...

Under the Hood: The JavaScript SDK - The use of polyfills - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: The JavaScript SDK - The use of polyfills geschrieben. Du kannst den vollständigen ...

JavaScript
The Facebook SDK for JavaScript provides a rich set of client-side functionality for adding Social Plugins, making API calls and implementing ...

Senior Front-End Developer (Javascript and AJAX)
Company: Sometrics Category: Software Development Location: Los Angeles, CA How to Apply: jobs@sometrics.com Description: We are looking for ...

Badass JavaScript (@badass_js) on Twitter
WebGLWorker is an open source library that allows using WebGL from Web Workers. Great work as always from @kripken . blog.mozilla.org/research/2014/… ...

Resources last updated: 1/13/2016 10:12:32 PM