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.


0
nick
3/16/2001 11:24:51 PM
sybase.powersite 2112 articles. 0 followers. Follow

3 Replies
1553 Views

Similar Articles

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

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("<SCRIPT language=javascript>");
psDocument.WriteLn("function getValue()");
%>

This way your client value is essentially your server side value(and vice
versa) and can be accessed easily.

Davlon

nick wrote:

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

0
GothicCastle
3/20/2001 8:32:41 AM
From client script you need to link to a page in order to fire off a server
script. You can link to the current page and pass parameters to indicate
it's a reload or whatever and process based on that.

A server-side script can create HTML hidden forms to store information,
that's one way.  Another is to have the server script create the client-side
script that part of the page with document.write statements and then set
values  based on anything that exists in the server script.

--

Larry Cermak [Team Sybase]

Web DataWindow Articles: http://my.sybase.com/detail?id=1003371

"nick" <nick@compulink.gr> wrote in message
news:BumKDeTsAHA.301@forums.sybase.com...
> Thanks for your awner but i have the folloowing questions.
> First, How can i call server-side script from a client-side script.
> Second, How can i pass a value from server-side script back into the
> client-side script
> In your example, you call client-side script from server-side script only.
> thanks in advance.
>
>
> "^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message
> news:3AB715A8.FA511847@hotmail.com...
> > 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("<SCRIPT language=javascript>");
> > psDocument.WriteLn("function getValue()");
> > %>
> >
> > This way your client value is essentially your server side value(and
vice
> > versa) and can be accessed easily.
> >
> > Davlon
> >
> > nick wrote:
> >
> > > 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.
> >
>
>


0
Larry
3/20/2001 3:41:36 PM
Thanks for your awner but i have the folloowing questions.
First, How can i call server-side script from a client-side script.
Second, How can i pass a value from server-side script back into the
client-side script
In your example, you call client-side script from server-side script only.
thanks in advance.


"^*^GothicCastle^*^" <^*^GothicCastle^*^@hotmail.com> wrote in message
news:3AB715A8.FA511847@hotmail.com...
> 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("<SCRIPT language=javascript>");
> psDocument.WriteLn("function getValue()");
> %>
>
> This way your client value is essentially your server side value(and vice
> versa) and can be accessed easily.
>
> Davlon
>
> nick wrote:
>
> > 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.
>


0
nick
3/21/2001 12:02:33 AM
Reply:

Similar Artilces:

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

client-side scripting or server-side scripting
I want to perform data validation in my page using javascript before the data is sent to my server, but I am very confuse that I don't know which way to perform, client-side validation or server-side validation? My javascript bible told me that javascript is a client-side scripting for data validation in client pc, but when I look in my asp.net bible, the validation part is done at server side. The worst is that, I find no way to use javascript in .asp or .aspx environment. I am really confuse with all these, could any one help me on this? Thanks. Use .NET validator co...

client side script Vs Server side Script
Which is better ? Using Client Side validations with Java Script or Using Server Side validation controls provided in asp.net You should use both... Client-side for a rich user experience and server-side to support browsers without javascript support or with javascript turned off....

Difference between client side scripting and server side scripting
Hi,      Can u  plz, explain why the server side scripting is necessary, inorder to write the client side scripting. What is the main difference between the client side scripting and server side scripting. Client-side scripting is code that is executed on the client side, such as JavaScript. Server-side scripting is code that is executed on the server, such as VB, VB.NET, C#, or J#. For a better definition of server-side scripting and when it's necessary, please visit http://en.wikipedia.org/wiki/Server-side_scriptingRyan OlshanASPInsider | Microsoft MVP...

Client-Side scripting vs Server-Side scripting
hello I need an article that spaeks about Client-Side scripting vs Server-Side scripting,and when i need to use one of them thank you for the help and for the time here are some good links to a bunch of articles on that subject...

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

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

Client side script calling Server side functions
Hi, I'm currently developing an ajax.net enabled aspx page that contains a usercontrol (which is based on the listbox but extends it to include icons to represent invalid data). http://www.djcharlie.co.uk/WeeeCareResolutionCentre.jpg I want the onClick event of the selected TR to call an asp.net 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...

ASP.NET: Client-side scripts VS Server-Side scripts
Hello folks, I am new here and I have not looked around much yet so if my dilema was discussed somewhere already, give me the links where, please. I am a hard-core ASP scripter who is about to transform to ASP.NET just these days. There is one thing that bothers me about this new philosophy and I am not sure if there is a handle for it in this technology or we - programmers, have to look for our own way. This thing is the dilema Client-side vs Server-side scripts. Of course, I want to be making everything mainly fast and convenient for users. So utilizing classical ASP technology, I...

Acessing Variable, declared in the client side script, from the server side script
I'd like to know how can I use variables declared in the client side script from the server side script. Thanks! You cannot. The only way is to pass them as arguments to the server-side script. -- Larry Cermak [Team Sybase] Corporate Technology Partners EAServer Training & Consulting Coming Soon: Web DataWindow Book Web DataWindow Articles: http://my.sybase.com/detail?id=1003371 "Jeong-Su, Hwang" <hjs@i4biz.co.kr> wrote in message news:s9YmFSfKAHA.201@forums.sybase.com... > I'd like to know how can I use variables declared in the cl...

Acessing variables, declared in the server side script, from the client side script
I'd like to know how can I use variables declared in the server side script from the client side script. P.S.: I'm using JavaScript in the server side script and in the client side script. I don't like to use ASP. Thanks! One example that come to mind: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=windows-1252" http-equiv="Content-Type"> <META name=GENERATOR content="MSHTML 5.00.2919.6307"> <SCRIPT language=JavaScript> ...

How do I call server side function in client side script without using __doPostBack
Hello, My page has a server side panel that is hidden when the page loaded, checkboxes inside of the datagrid, and buttons.  If at least one checkbox is not clicked and the user click on the button, I show the panel.  When the user click on one of the checkbox, I want to hide the panel.  Onclick on the checkbox I already have a cleint function to change the row color.  I don't want to use __doPostBack.  Don't want to do postback. My question are: How do I either have checkbox onclick called both client and server side functions.  Or have the client side func...

Client-Side and Server Side Scripting
Hi, im currenty in the process of trying to get an asp.net page to work with both <script> and <script runat="server" tags... idea being, i have a <script> tag which holds all the client side scripting for my webpage, at the moment this is just some slider controls which i have created (the scripting behind this is actually from someone on a different forum, which i have modified to do what i want..) - but i also want a <script runat="server"> tag to hold all the code for the buttons pressed etc in my web-page. im trying my hardest not to use a ...

without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible?
without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible? avdp211:without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible? I don't think it is possible.You use the the HTML input file control and when you post the request, on the web server you need to read the data and save it to a file, so there has to be some interaction with the server to handle the post request.  Not possible vi...

Server side Variable in client side script
Hello, I want to access the variable defined in the server side script from the client side. Can anyone help out with an example ??? TIA, Rakesh Babaria I think what you do is write is as a java script variable, so something like this: <!--SCRIPT var ls_serverVar ls_serverVar = "whatever"; document.writeln("<SCRIPT language=JavaScript>"); document.writeln("var xyz = " + ls_serverVar); document.writeln("</SCRIPT>"); --> Then in your client script, you'll be able to get XYZ. ...

Passing Server Side Control to Client Side Script
Hi All, I have an asp:DropDownList and an asp:TextBox on my form. I want to disable or enable the textbox depending on the selection in the dropdown. I am using master pages and the problem is that when I use the onChange event for the dropdown on the client side, I don't know the ID of the the textbox on the client side to disable or enable it.  How can something like this be done? Thanks,AKA You can use the ClientID property of a control to determine the ID, something like:  <script type="text/javascript"> function ShowMeTheID(){ alert('...

Cannot register client script from server side script tag
I'm trying to register a client script from vb.net code in a server script tag in the .aspx file like so:    Private Sub RegisterFtpFolderClientScript()            'Register the returnValue client script      Dim script As String      Dim ftpServer As String = ConfigurationManager.AppSettings("FtpServer")       script = "<script type='text/javascript'>" & vbCrLf _        &...

Call Client script from Server Side
Hi All,I want to call javascript function from server side  when I am using updatePanel.Actual Scenario is as follows: I have one form A.aspx in which I have a button named "btn_display" and this button is in Update Panel.Now I call server side function on btn_display_click and from that server side function i want to call javascript function.How should I proceed??Plz helpThanks in advance  HI,    You can use registerclientscriptblock to allow the client script to work from a serverside event Hello, RegisterStartupScript is more appropriate for thi...

call client script from server side
does anybody know how to call a client script function from server side code Button1.Attributes.Add("onclick", "JavaScript:clientScriptFunction();"); Or: private void Button1_Click(object sender, System.EventArgs e){     string scriptKey = "ClientScriptFunction";      System.Text.StringBuilder sbScript = new System.Text.StringBuilder();     sbScript.Append("<script language=JavaScript>\n");     sbScript.Append("<!--\n");     sbScript.Append("clientScriptFunction();\n"); &nbs...

Can you pass information from client side script to server side
Is it possible to pass information from client side to server side without the use of cookies? i am creating textbox's that i generate in a loop that are displayed to the screen and i need to access the values in those boxes. I can get them with javascript but dont know how to use asp to get them??? thanks The last sample on this page shows how your client-side script can send information back to your server-side code. I hope this helps.Alister...

passing data to a server side textbox from client side script
Qu: passing data to a server side textbox from client side java script.Does anyone know how to do this?Thanks,Graham. Remember that when you view an aspx page in your browser, you are viewing straight html code (view the source).  Thus, access the textbox as you would a normal <input type="text> tag.HTH, rchern.Churned Ajax ToolkitPlease choose "Mark as Answer" for the posts that lead you to a solution....

How to pass param values from server side to client side scripts
Hi, I have a page containing a datagrid with a list of geographic positions of interesting places. Users can filter this grid. Clicking an item the system displays the place on a map using MS Virtual Earth map component that exposes a client side javascript api. My problem is that the filtering is done on server side, but the map runs on client side. So during page load, I need to create long strings containing complex javascript codes on the server side, and add it as an event handler attribute to my components. This causes a lot of problems, for exemple...

Calling client side script from server control
I have been trying to get a couple of radio buttons on an ASP.Net page to respond to a user click by running a javascript.  I used the following code:     Protected Sub rdoExistProject_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoExistProject.PreRender        rdoExistProject.Attributes.Add("onClick", "test")    End Sub The rendered HTML looks as I was expecting it to, as follows: <input id="ctl00_cphMain_rdoExistProject" type="radio" name="ctl00$cphMain$NewTask" value="rdoExistProject" on...

Can clients call server-side scripts?
I have so many questions right now I thought it would be easier to just list them out. Please forgive the mechanical look. I am very grateful for your continued help! Can I create a plain ol' button (i.e., type=button) in a page and have it call a server-side script? If so, what would be the syntax of the INPUT tag? Can server-side variables can be accessed from the client? I.e., could that button call a client-side script which accesses the PSOM, e.g., the database and/or the session global variable? Thinking of being able to do this makes a red flag go in my mind with ...

Web resources about - Call server-side script from client-side script - sybase.powersite

Server-side scripting - Wikipedia, the free encyclopedia
... unfocused, scattered, unnecessary details. WikiProject Technology or the Technology Portal may be able to help recruit an expert. Server-side ...

Google Cloud Platform simplifies server-side development for iOS w/ ‘Mobile Backend Starter’
... Mobile Backend Starter that first debuted for Android developers back in June. Google says the application helps to simplify the server-side ...

Free Cooling: the Server Side of the Story
Servers that support higher inlet temperatures could significantly reduce or even eliminate the cooling costs of the data center. We received ...


[Update: Check Now] Play Store For Android Gets Search Bar With Hamburger Flip In Server-Side Update
Google is pushing out an update to the Play Store's Android interface that replaces the action bar with a standard search bar. Inside are the ...

Server-side update makes Siri a stickler for succinctness
Siri is already well known for her wit and willingness to joke, but a recent server-side update has given Apple's digital assistant the ability ...

Japanese RIAA wants server-side music DRM for mobile phones
The Recording Industry Association of Japan—the Japanese version of the RIAA— …

New BaaS platform aims to eliminate writing server-side code
... offering for desktop and mobile developers that's now leaving its beta phase. By removing the need for writing code on the server-side, Backendless ...

Dart improves async and server-side performance
... Team Today's release of the Dart SDK version 1.3 includes a 2x performance improvement for asynchronous Dart code combined with server-side ...

Customize Google Using Server-Side Scripts
Google's services have a lot of powerful features, but they can't offer all the options requested by users. A popular way to customize Google ...

Resources last updated: 2/17/2016 6:13:23 AM