473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Atlas/JavaScript getting started problem

I'm trying to get started with Atlas and associated necessary javascript at
the same time. I started out at
http://atlas.asp.net/walkthroughs/ge...rted/basic.net where they have
an application (which I have pasted below) that displays a string returned
from a web service.

One problem is that the application doesn't work. It errors out at....

Samples.AspNet.HelloWorldService.HelloWorld(SrchEl em.value,OnRequestComplete);

saying that Samples is undefined. Can anyone tell me what is wrong?

Another thing I'm curious about is that the author of the article said it
was necessary to NOT use a codebehind file but did not say why. Why can't a
code-behind file be used?

Thanks,
T

------------------------------------------------------------------------------------
<%@ Page Language="C#" Title="Atlas Script Walkthrough" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">
<atlas:ScriptManager runat="server" ID="scriptManager">
<services>
<atlas:servicereference path="~/HelloWorldService.asmx" />
</services>
</atlas:ScriptManager>
<style type="text/css">
body { font: 11pt Trebuchet MS;
font-color: #000000;
padding-top: 72px;
text-align: center }

.text { font: 8pt Trebuchet MS }
</style>

</head>
<body>
<form id="Form1" runat="server">
<div>
Search for
<input id="SearchKey" type="text" />
<input id="SearchButton" type="button"
value="Search"
onclick="DoSearch()" />
</div>
</form>
<hr style="width: 300px" />
<div>
<span id="Results"></span>
</div>
<script type="text/javascript">

function DoSearch()
{
var SrchElem = document.getElementById("SearchKey");
Samples.AspNet.HelloWorldService.HelloWorld(SrchEl em.value,
OnRequestComplete);
}

function OnRequestComplete(result)
{
var RsltElem = document.getElementById("Results");
RsltElem.innerHTML = result;
}

</script>
</body>
</html>
Sep 11 '06 #1
2 1844
I am not sure what your web service code looks like, but you may have an
issue with the namespace name. If you could post that code, that would be
great.

As for the code-behind comment, I believe the author was stating that you do
not need to use the code behind for the ASPX page. Since atlas is calling a
web service you may or may not need to implement any code-behind for your
aspx page. If you are not performing any post back routines then you wouldn’t
necessarily need any code behind.

Daniel C. Di Vita
"Tina" wrote:
I'm trying to get started with Atlas and associated necessary javascript at
the same time. I started out at
http://atlas.asp.net/walkthroughs/ge...rted/basic.net where they have
an application (which I have pasted below) that displays a string returned
from a web service.

One problem is that the application doesn't work. It errors out at....

Samples.AspNet.HelloWorldService.HelloWorld(SrchEl em.value,OnRequestComplete);

saying that Samples is undefined. Can anyone tell me what is wrong?

Another thing I'm curious about is that the author of the article said it
was necessary to NOT use a codebehind file but did not say why. Why can't a
code-behind file be used?

Thanks,
T

------------------------------------------------------------------------------------
<%@ Page Language="C#" Title="Atlas Script Walkthrough" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">
<atlas:ScriptManager runat="server" ID="scriptManager">
<services>
<atlas:servicereference path="~/HelloWorldService.asmx" />
</services>
</atlas:ScriptManager>
<style type="text/css">
body { font: 11pt Trebuchet MS;
font-color: #000000;
padding-top: 72px;
text-align: center }

.text { font: 8pt Trebuchet MS }
</style>

</head>
<body>
<form id="Form1" runat="server">
<div>
Search for
<input id="SearchKey" type="text" />
<input id="SearchButton" type="button"
value="Search"
onclick="DoSearch()" />
</div>
</form>
<hr style="width: 300px" />
<div>
<span id="Results"></span>
</div>
<script type="text/javascript">

function DoSearch()
{
var SrchElem = document.getElementById("SearchKey");
Samples.AspNet.HelloWorldService.HelloWorld(SrchEl em.value,
OnRequestComplete);
}

function OnRequestComplete(result)
{
var RsltElem = document.getElementById("Results");
RsltElem.innerHTML = result;
}

</script>
</body>
</html>
Sep 11 '06 #2
It is definitely the namespace -- I had the same error.

Change:
Samples.AspNet.HelloWorldService.HelloWorld(SrchEl em.value,
OnRequestComplete);
to where ever your web service is located in your project -- mine was just

HelloWorldService.HelloWorld(SrchElem.value,OnRequ estComplete);



"Tina" wrote:
I'm trying to get started with Atlas and associated necessary javascript at
the same time. I started out at
http://atlas.asp.net/walkthroughs/ge...rted/basic.net where they have
an application (which I have pasted below) that displays a string returned
from a web service.

One problem is that the application doesn't work. It errors out at....

Samples.AspNet.HelloWorldService.HelloWorld(SrchEl em.value,OnRequestComplete);

saying that Samples is undefined. Can anyone tell me what is wrong?

Another thing I'm curious about is that the author of the article said it
was necessary to NOT use a codebehind file but did not say why. Why can't a
code-behind file be used?

Thanks,
T

------------------------------------------------------------------------------------
<%@ Page Language="C#" Title="Atlas Script Walkthrough" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">
<atlas:ScriptManager runat="server" ID="scriptManager">
<services>
<atlas:servicereference path="~/HelloWorldService.asmx" />
</services>
</atlas:ScriptManager>
<style type="text/css">
body { font: 11pt Trebuchet MS;
font-color: #000000;
padding-top: 72px;
text-align: center }

.text { font: 8pt Trebuchet MS }
</style>

</head>
<body>
<form id="Form1" runat="server">
<div>
Search for
<input id="SearchKey" type="text" />
<input id="SearchButton" type="button"
value="Search"
onclick="DoSearch()" />
</div>
</form>
<hr style="width: 300px" />
<div>
<span id="Results"></span>
</div>
<script type="text/javascript">

function DoSearch()
{
var SrchElem = document.getElementById("SearchKey");
Samples.AspNet.HelloWorldService.HelloWorld(SrchEl em.value,
OnRequestComplete);
}

function OnRequestComplete(result)
{
var RsltElem = document.getElementById("Results");
RsltElem.innerHTML = result;
}

</script>
</body>
</html>
Sep 13 '06 #3

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

Similar topics

1
by: sales | last post by:
Hi Does ATLAS support the use of external javascript va this syntax --myPage.aspx-- atlas:ScriptManager ID="ScriptManager1" runat="server"> <Services> <atlas:ServiceReference...
1
by: amit | last post by:
Hi. I want to implement a right click context menu using Atlas for a web app. The page will list some usernames. Right clicking on a username needs to send the user name to a webservice,...
1
by: Ronde | last post by:
Hi all, I am in a such situation that requires before Atlas do the Partical/Atlas postback, a Client-Side JavaScript has to be executed first, once the JavaScript execute successfully, the...
6
by: hangar18 | last post by:
Hi, We have a web page with a javascript menu on the left hand side. On click of the javascript menu, we want some content to be displayed but without the whole page getting refreshed. We are...
2
by: A.Wussow | last post by:
Hi Everybody, i want to load dynamically content from some user controls (with forms, or some data-controls) using atlas. So i use an UpdatePanel for loading the user control into a placeholder....
1
by: TARUN | last post by:
Hello All, I am facing problem regarding Atlas. I have install the AtlasSetup.msi in my .NET framework 2.0, and i open the new Atlas Website...... Let me first explain the my senario, I...
1
by: TARUN | last post by:
Hello All, I am facing problem regarding Atlas. I have install the AtlasSetup.msi in my .NET framework 2.0, and i open the new Atlas Website...... Let me first explain the my senario, I...
3
by: mkr04 | last post by:
Hi Friends I am facing also Unk 8) nown error problem. In have page where I am using a User Control when I am using ATLAS to this page I have same problem, I have tried it by debugging but there...
1
by: jmdolinger | last post by:
Hi all, I'm a newbie to Atlas (and recently ASP.NET) after coming from a long Java background, also have done quite a bit with an Ajax.NET/ASP.NET 1.1 project, but it was basically all...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.