473,670 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

call server side function from javascript .net 2008??

52 New Member
well i try to call a server side function from the javascrpt like this but it seemed that it is impossible with this way , anybody knows how could be done this???? :


in the aspx i have:

<script language="javas cript">

function WindoClose() {
'<%=myserversid eFunction%>'

window.close();
</script>

<td colspan="2" align="right" valign="top" style="padding: 0 17 49 0;"><a href="#" onclick = "WindoClose ;" ><img src="images/closePopup.gif" border="0" /></a></td>
Sep 8 '08 #1
3 1232
Frinavale
9,735 Recognized Expert Moderator Expert
You have to use Ajax to call server side code.

Please provide more details about what you are trying to do so that I can provide a more helpful answer.

-Frinny
Sep 8 '08 #2
chriskaza81
52 New Member
You have to use Ajax to call server side code.

Please provide more details about what you are trying to do so that I can provide a more helpful answer.

-Frinny

well what i trya to do is execute one funcion in code behind and the close the window
Sep 9 '08 #3
Frinavale
9,735 Recognized Expert Moderator Expert
well what i trya to do is execute one funcion in code behind and the close the window
Well if you execute the function in a LinkButton click, place the LinkButton within an UpdatePanel, place the code that you want to execute in the Click event for the LinkButton and have the page load normally.

This will cause an asynchronous Ajax call to fire which will execute the LinkButton Click event (in turn executing the code you need to run) and only the UpdatePanel that the LinkButton is in will refresh when the page is re-rendered in the browser.

-Frinny
Sep 9 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

15
4203
by: chirs | last post by:
I am trying to understand a piece of code. In a javascrpit file, there is a function: function ItemStyle(){ var names=; addProps(this,arguments,names,true); }; In the html file, it calls the function as:
1
5060
by: cheezebeetle | last post by:
ok, so I am having problems passing in an ASPX function into the Javascript in the codebehind page. I am simply using a confirm call which when they press "OK" they call this ASPX function, when they press "Cancel" they call another ASPX function. My code now is: System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=""JavaScript"">" & vbCrLf) System.Web.HttpContext.Current.Response.Write("if (confirm('Are you sure you want to...
3
6777
by: David Shorthouse | last post by:
Hey folks, Not an off-topic posting.....since I was shot-down in an earlier post...this one's legit. How do I go about calling a server-side vbscript within a client-side javascript function? What I have is a page heavy on the javascript that has a number of functions, one of which is to begin a visual countdown with an onclick and also open an asp page containing the server-side vbscript, which initiates a wake-on-lan call. I had no...
39
6525
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. When it completes, it can call a success, or a failure function. The names of these success, or failure functions will differ, and I'd like to know how I can pass the name of a function to my tool, and how my tool can call the function, using that...
3
15500
by: lanem | last post by:
I want to call a server-side function, like a button's click event, from a client-side JavaScript function. How do I do that? Thanks.
4
3903
by: abcd | last post by:
I am novice asp.net programmer. I have xyz.js file which has resuable functions. I have asp.net form abcd.aspx and the code behind file abcd.aspx.cs, I want to put a 'Help' button when clicked it will open a window and open the required file for me. I am have issues 1.I tried calling my xyz.js function i.e. ShowHelp in the call like in my
10
2250
by: Paul | last post by:
Hi I am using the HtmlInputFile control to upload a file from a client to a server. I have a browse to find the file on the server but need to create the path dynamically as to were it will go based on some dropdown boxes, one for the year and one for the month. This line saves the file so I am trying to get the month and year from the dropdown boxes and put them in the month and year variables but this does not work,...
1
20610
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but I don't see the error): "System.IO.IOException: Unable to read data from the transport connection:A blocking operation was interrupted by a call to WSACancelBlockingCall"
5
2154
by: Simon | last post by:
I heard that we could do that by using AJAX. Could anybody share how to do it? Thanks.
0
8471
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8903
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8592
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8661
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6216
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5686
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4393
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.