473,769 Members | 4,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling server site script from Javascript using ATLAS

Hi All,

I'm new to Atlas and I did some programming using AJAX, but I'm
wondering if it is possible to hava a javascript which can call a
server-site function, in my case to write data to the cache, using
AJAX. So I'm not looking for a possibility to wrap-up controls, but
just to call server-site code from ATLAS.

I know this can be done using AJAX, so in my opinion this should also
be possible using ATLAS, or can ATLAS just be used to wrap up controls?

Thx for replies.

Sep 23 '06 #1
4 2043
Yes, this can certainly be done using Atlas.
Atlas can call web services that you write via AJAX.

Here are the details:
http://atlas.asp.net/docs/atlas/doc/...consuming.aspx

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net
<s.*******@syma x.nlwrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
Hi All,

I'm new to Atlas and I did some programming using AJAX, but I'm
wondering if it is possible to hava a javascript which can call a
server-site function, in my case to write data to the cache, using
AJAX. So I'm not looking for a possibility to wrap-up controls, but
just to call server-site code from ATLAS.

I know this can be done using AJAX, so in my opinion this should also
be possible using ATLAS, or can ATLAS just be used to wrap up controls?

Thx for replies.

Sep 24 '06 #2
Hi Steve,

thanks for the reply, but is developing a webservice for such a small
function not a little overkill. Of course I can combine AJAX and ATLAS.
Just a simple function for writing to the cache using an AJAX dll and
for controls use ATLAS.


Steve C. Orr [MVP, MCSD] schreef:
Yes, this can certainly be done using Atlas.
Atlas can call web services that you write via AJAX.

Here are the details:
http://atlas.asp.net/docs/atlas/doc/...consuming.aspx

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net
<s.*******@syma x.nlwrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
Hi All,

I'm new to Atlas and I did some programming using AJAX, but I'm
wondering if it is possible to hava a javascript which can call a
server-site function, in my case to write data to the cache, using
AJAX. So I'm not looking for a possibility to wrap-up controls, but
just to call server-site code from ATLAS.

I know this can be done using AJAX, so in my opinion this should also
be possible using ATLAS, or can ATLAS just be used to wrap up controls?

Thx for replies.
Sep 24 '06 #3
Hi,

s.*******@symax .nl wrote:
Hi Steve,

thanks for the reply, but is developing a webservice for such a small
function not a little overkill. Of course I can combine AJAX and ATLAS.
Just a simple function for writing to the cache using an AJAX dll and
for controls use ATLAS.
The simplest implementation of AJAX in .NET is using ASHX Custom
HttpHandlers. It's very simple: In your web site or web application
project, Add New Item / Generic handler.

Then, in the code behind, implement the methods (Studio 2005 gives you a
template).

From the client, use JavaScript and XmlHttpRequest to send the request
and read the response. There are many tutorial online.

Example for a simple asynchronous request:

var oHttp = null;
if ( window.XMLHttpR equest )
{
oHttp = new window.XMLHttpR equest();
}
else
{
if ( window.ActiveXO bject )
{
oHttp = new window.ActiveXO bject( "Microsoft.XMLH TTP" );
}
else
{
throw "UNSUPPORTE D PLATFORM";
}
}
if ( !oHttp )
{
throw "Cannot create XmlHttpRequest" ;
}

var strQuery = "?param1=value1 &param2=value2" ;
oHttp.open( "GET",
"myHandler.ashx " + strQuery,
true ); // true = async, false = sync

oHttp.onreadyst atechange = function()
{
if ( oHttp.readyStat e == 4 )
{
oHttp = null;
fnCallback( oHttp );
}
}

oHttp.send( null );

Code behind:

In ProcessRequest, use the "context" parameter to extract the
QueryString, and then you can process according to the parameters.

For the Response, if you want to send XML code back, make sure to set
context.Respons e.ContentType = "text/xml; charset=utf-8";

To save an XML document to the response, use
docResponse.Sav e(
new XmlTextWriter( context.Respons e.OutputStream,
context.Request .ContentEncodin g ) );
In the JavaScript, the XML code will be available in oHttp.responseX ML.
The response is also available in plain text in oHttp.responseT ext. Also
check the oHttp.status, which contains status like 200 (OK), 500 (Server
error), etc...

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Sep 24 '06 #4
Hi Laurent,

thx for the reply. I read some article on the Inet. I was thinking in
the same direction. User ATLAS for the teriffic controls and an AJAX
lib (or CallbackEventHa ndler but this is limited for IE) for the other
stuff.

Again, thanks guys.


Laurent Bugnion schreef:
Hi,

s.*******@symax .nl wrote:
Hi Steve,

thanks for the reply, but is developing a webservice for such a small
function not a little overkill. Of course I can combine AJAX and ATLAS.
Just a simple function for writing to the cache using an AJAX dll and
for controls use ATLAS.

The simplest implementation of AJAX in .NET is using ASHX Custom
HttpHandlers. It's very simple: In your web site or web application
project, Add New Item / Generic handler.

Then, in the code behind, implement the methods (Studio 2005 gives you a
template).

From the client, use JavaScript and XmlHttpRequest to send the request
and read the response. There are many tutorial online.

Example for a simple asynchronous request:

var oHttp = null;
if ( window.XMLHttpR equest )
{
oHttp = new window.XMLHttpR equest();
}
else
{
if ( window.ActiveXO bject )
{
oHttp = new window.ActiveXO bject( "Microsoft.XMLH TTP" );
}
else
{
throw "UNSUPPORTE D PLATFORM";
}
}
if ( !oHttp )
{
throw "Cannot create XmlHttpRequest" ;
}

var strQuery = "?param1=value1 &param2=value2" ;
oHttp.open( "GET",
"myHandler.ashx " + strQuery,
true ); // true = async, false = sync

oHttp.onreadyst atechange = function()
{
if ( oHttp.readyStat e == 4 )
{
oHttp = null;
fnCallback( oHttp );
}
}

oHttp.send( null );

Code behind:

In ProcessRequest, use the "context" parameter to extract the
QueryString, and then you can process according to the parameters.

For the Response, if you want to send XML code back, make sure to set
context.Respons e.ContentType = "text/xml; charset=utf-8";

To save an XML document to the response, use
docResponse.Sav e(
new XmlTextWriter( context.Respons e.OutputStream,
context.Request .ContentEncodin g ) );
In the JavaScript, the XML code will be available in oHttp.responseX ML.
The response is also available in plain text in oHttp.responseT ext. Also
check the oHttp.status, which contains status like 200 (OK), 500 (Server
error), etc...

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Sep 25 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1947
by: Adam Atlas | last post by:
(Apache/2.0.55, PHP/4.4.1) I am using an "Action" directive in my Apache configuration to map a certain file type (by means of AddType and AddHandler) to a PHP script. I wasn't sure if this would work, since the Apache docs say the Action directive is for mapping a handler name to a CGI script in particular. But it seemed to work at first. Then a mysterious bug arose: Sometimes it works perfectly, and other times the output is a totally...
4
12416
by: KK | last post by:
Hi, Does anybody know how to call server side function in javascript? Suppose I've a method named Test() at code behind of ASP.Net page. How can I call that method in javascript function ??? Any help is appreciated..
3
52225
by: Steve Kershaw | last post by:
Hi, I need to fire a server side button click event from my client side javascript. The client side javascript code follows: <script language="javascript" type="text/javascript"> function myFunction() { var strname; strname = prompt("What is your name", "");
2
1922
by: pamelafluente | last post by:
Hi dears, I have a plain HTML page. I want to render it a little interactive. I was thinking to add to it 1 script and events to the elements I want to make interactive. Then, I need to talk with an ASP.NET page which would actually do some processing on the server. Processing may include a replace (regeneration) of the above HTML page, for further interaction.
0
1406
by: Daniel | last post by:
I wrote a pretty neat website today that can utilize no postback AJAXIAN type features. Basically to populate a drop down with a web service call that hits a SQL server, based off the change of another drop down. <%@ Page Language="C#" Title="Call Update" AutoEventWireup="true" CodeFile="UpdateCall.aspx.cs" Inherits="Call_UpdateCall" %>
9
1466
by: lanem | last post by:
I installed atlas on my dev machine and everything works great. When I try to get it working on the server, I get this error when building the page: "Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed" on the line where I have the ScriptManager tag. I set everything up the same as I did on my dev machine, but nothing works. I added the...
5
1065
by: =?Utf-8?B?Q2FybG8gRm9saW5p?= | last post by:
Hi, I'm starting studying ATLAS. First thing that I'm concerned about is if the ATLAS controls are a pluggable options for server side controls.. What I wonder is if the case ATLAS extension are turned off and the site continue to work server side only or the site logic is blocked. This is particular important in accessible scenarios or when the user disables javascript in the browser.
4
3872
by: gengyue | last post by:
Hi, I need to call .Net webservice from my JSP page. My application is Struts application. It is deployed on Oracle application server. Here is the whole process. I have a login form. When user hit login button, my Action class will validate the user information and send his information to the other site by calling .Net web service, so the other site can extract these information. So, in my jsp, I am using Javascript and webservice.htc to...
4
4124
by: gengyue | last post by:
Hi, I need to call .Net webservice from my JSP page. My application is Struts application. It is deployed on Oracle application server. Here is the whole process. I have a login form. When user hit login button, my Action class will validate the user information and send his information to the other site by calling .Net web service, so the other site can extract these information. So, in my jsp, I am using Javascript and webservice.htc to...
0
9590
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
9424
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
10223
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
10000
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
9866
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...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.