Calling a sever side code behind sub routine from client side java script


is it possible to call a server side sub routine from client side javascript
what I what to do is call a form based email routine from the client, I am hoping that by doing it this way I can disable the button used to call the routine imeadiatly so it's only possible to click it 1 time to prevent the same email being send multiple times, and in addtion start a client routine to indicate the email is underway with some graphic of some sort so the use knows that something is happening, all this is because if the attacment is quite large it takes a little while for the procees to complete making it appear that nothing much is happening
so to sum up can I call Call subSendEmail() in a code behind form for javascript on the client
If I can could some1 give me a code sample please

1/12/2005 9:46:39 PM 24353 articles. 2 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 5
Get it on Google Play
Get it on Apple App Store

You can't call from server-side to client-side and vice-versa.  But, you can drop client-side code and trigger server-side events to provide similar functionality.

To keep the click from being firable twice and show a progress indicator add a client-side handler:
onclick="this.disabled=true;'<Animated gif popup URL>','ProgressWindow');"
Keep the same server-side handler to do the email and when you render the page after the postback do:
Page.RegisterStartupScriptBlock("ProgressClose","<script language='javascript'>var'','ProgressWindow'); winRef.close();</script>");
1/13/2005 12:31:24 PM

Similar Artilces:

Call server-side script from client-side script
Hi to all, I would like to ask you How can i call from client-side script a server-side script and to have the result from the server-side script in the client-side script. For example, i wand to call a function writing in server-side (DynaScript) script from a client-side script (JAVASCRIPT) and to have an answer from the function. Thanks in advance. Nick, One way that you could get round this is to write your client script code as you would server script eg. <SCRIPT language=javascript> function getValue()... would be written as: <% psDocument.WriteLn(&...

How to call a client side script from a server side script?
Hi guys, I have a Button1_Click function which gets executed on the server side as soon as Button1 is clicked. I have a client side function, test, which is  written in vbscript. I need to call this test function from the Button1_Click function. Can anyone of you please tell me how to do this? The test function is inside an asp:content tag (Please excuse my terminology if I am wrong, I am new to all this).  Thanks and Regards, RJ Have you tried to use the below code Button1.Attributes.Add("onclick","test()"); HCHaissam Abdul MalakMCAD.NET| Blog | Yes, ...

communication between client side(java script) and server side in .net project
I have a question which is, when building a .net project, we are able to use server side code and client side code(java script). How do they communicate? Thanks Client Side coding works with the WebBrowser. So when ever you write client side code you have to keep browser compatability in your mind and you have to code. Server Side code works with Web Server (IIS) and it's ASPNET ISAPI's. The won't directly communicate with each other. But using AJAX you can all server side code from Client Side! Example article on Ajax@

Passing Client side variables from Java script to sever side variables
HiI have some code that worked fine in Net 1.1 but now doe's not work in Net 2.0 what I want to do is pass a couple of variables generated in javascipt on the client side to the server to use in server variables, below is the code that used to work var imageheight,imagewidth;imageheight = (document.images[0].height) + 80;imagewidth = (document.images[0].width) + 50; <!-- WindowWidth and WindowHeight are hidden Input feilds document.Form1.WindowWidth.value = imagewidth;document.Form1.WindowHeight.value = imageheight;Up to the imagewidth and the imageheight variables it works in so ...

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 are built on this architecture你好! Just FYI o_O...

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:   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...

Calling server side scripts from client side
Hello, Can Anyone help out from the following : It is regarding calling server side scripts from client side events. I am able to instantiate a jaguar component in the server side script written in the body of the HTML page as follows : <% var mycomp = java.CreateComponent ("pkg_dispatch/n_jaguar", "iiop://jaguar:9000", "Jagadmin", "" ); if (mycomp == null) { document.writeln("ERROR: failed to instantiate !"); return; } %> I want to use the instance of the jaguar component else wher...

Call client side script from code behind
Hi there, I'm trying to add two listboxes to a page so a user can move items between the lists. I need to create these list boxes in the code, as different listboxes appear for different users. The problem I'm having is that once I move the listbox creation to the code behind, I can't seem to get it to call the client side move function.  Here's me code (lines 13 and 20 contain the call to the javascript function that I'm getting wrong):   1 TableRow tableRow = new TableRow(); 2 TableCell lb1tableCell = new TableCell(); 3 lb1tableCell.Te...

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 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/////////////////////////...

Client side script calling Server side functions
Hi, I'm currently developing an enabled aspx page that contains a usercontrol (which is based on the listbox but extends it to include icons to represent invalid data). I want the onClick event of the selected TR to call an server function which then populates the controls to the right hand side in the page. Obviously because the row is just rendered HTML overriden from the base class I can only assign a javascript function to the onClick event. So I need a way of calling a server side function that will populate th...

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' 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,...

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 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 function from client side script
i have a web form that includes a function named "koko()" in its server side class i want to write a script code in in its HTML script that will be run at the client side, and this client side script will call the function "koko()" from the server side. in brief : i want to call a server side function from a client side script... can you help me in this You can't call server-side code directly from client-side code. You can, however, trigger a postback that your server-side code watches for and triggers the server-side code appropriately. You can do some ...

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: NC...  ...

Web resources about - Calling a sever side code behind sub routine from client side java script -

Calling Dr. Death - Wikipedia, the free encyclopedia
Calling Dr. Death (1943) is the first of the Universal Pictures Inner Sanctum mystery films . The "Inner Sanctum" franchise originated with a ...

List of country calling codes - Wikipedia, the free encyclopedia
This is a list of country calling codes defined by ITU-T recommendations E.123 and E.164 , also called IDD ( International Direct Dialling ) ...

Calling Batman: Bane Takes Over Ecko Unlimited Facebook Page
Bane, the villain in upcoming Batman feature film The Dark Knight Rises , turned his criminal mind toward the Ecko Unlimited Facebook page , ...

Facebook Video Calling - Facebook
Bring your conversations to life on Facebook. With face-to-face video calling, now you can watch your friends smile, wink and LOL. To get started, ...

Facebook’s Talktime program in India pays new mobile users in calling credit
... Facebook has launched its Talktime program in India which gives every new user who signs up with a mobile device 50 Rupees (almost $1) in calling ...

Berlin Calling (@neuraum) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Calling all foodies: Here comes @TwitterFood
There are many thousands of food-related Tweets people send on Twitter each day – Tweets about meals, ingredients, favorites, recipes and dining ...

Rounds Video Calling + Chat for iPhone 4, iPhone 4S, iPhone 5, iPhone 5c, iPhone 5s, iPad 2 Wi-Fi, iPad ...
Get Rounds Video Calling + Chat on the App Store. See screenshots and ratings, and read customer reviews.

Jewish leader condemns Camille Paglia for calling Taylor Swift a "Nazi Barbie"
... insulting Taylor Swift. A leading Australian Jewish organisation has denounced American cultural critic Camille Paglia for calling Taylor Swift ...

Resources last updated: 12/18/2015 11:13:25 AM