Saturday, March 24, 2012

My net edition can use atlas?Why but appears wrongly?

my net edition is:version 8.0.50727.42(RTM.050727-4200),I download am the newest atlas edition,But I test appears the mistake!

error is:Type is not define!

Type.registerNamespace('Samples.AspNet');
my code is:
<%@dotnet.itags.org. Page Language="C#" MasterPageFile="~/MyMain.master" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ScriptIncludes" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Head" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server">
<a href="http://links.10026.com/?link=javascript:showIt();">show it</a>
<script type="text/javascript" src="http://pics.10026.com/?src=aboutcontent.asmx/js"></script>
<script type="text/javascript">
function showIt()
{
alert(Samples.AspNet.AboutContent.HelloWorld());
}
</script>
</asp:Content>
AboutContent.asmx:
<%@dotnet.itags.org. WebService Language="C#" Class="Samples.AspNet.AboutContent" %>
using System;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Configuration;
namespace Samples.AspNet
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class AboutContent : System.Web.Services.WebService
{
        [WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}
Why can appear such mistake?  Is what my edition question or?  Please  advises, extremely thank, I did well several weeks for this question!   Once more thank

I already solved this problem, extremely thank the time which but I like this did:

alert(Samples.AspNet.AboutContent.HelloWorld());

Returns:[object object]

I must like this write:

alert(Samples.AspNet.AboutContent.HelloWorld(onComplete));

...

function onComplete(ret)

{

alert(ret);

}

If I do not want to write: onComplete, do I have how to do only then can obtain WebService return value? Please advises, extremely thank


please help me!!

thanks!!


The whole idea is that the call is asynchronous. You must write OnComplete.

No comments:

Post a Comment