Hi,
have no Visual Studio here, but this will be wrong. Change following
lines in the WebForm1.aspx.cs:
Before:
private void Page_Load(object sender, System.EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(this.GetType());
// Put user code to initialize the page here
}
After:
private void Page_Load(object sender, System.EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(typeof(WebForm1));
// Put user code to initialize the page here
}
In the JavaScript part use following code:
<script type="tex/javascript">
<!--
function SayHello_callback(res) {
if(res.error == null) {
$("Resp").innerHTML = res.value;
} else {
$("Resp").innerHTML= res.error.Message;
}
}
function SayHello() {
SampleAjaxPro.WebForm1.HelloWorld(SayHello_callback);
}
//-->
</script>
Did you had a look at the example files?
Regards,
Michael
On 5/22/06, Rodrigo Diniz <[EMAIL PROTECTED]> wrote:
>
> Hi MIchael I built a simple project to show the error..
> I tried to use Ajax.net pro instead Ajax.net also, and it returns a
> different error message.
> If you comment out the simple line
> Session["hello"]="world";
> and recompile the project everithing works as expected..,.
> Please help me ...this is urgent.
>
>
> On 5/22/06, Michael Schwarz <[EMAIL PROTECTED]> wrote:
> > Can you please send me the project?? Maybe you have an example project
> > which is not working, too.
> >
> > Regards,
> > Michael
> >
> >
> > On 5/22/06, rodiniz <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi Michael .
> > > Even a simple "Hello world" using ajax returns a error 500 when I put
> > > the session handling code in the event.(wich has nothing to do with
> > > ajax)
> > > The code works fine on all pages that are not using ajax, so is not a
> > > problem with that code.
> > >
> > > X-Google-Language: ENGLISH,ASCII-7-bit
> > > Received: by 10.11.53.63 with SMTP id b63mr126852cwa;
> > > Mon, 22 May 2006 08:33:57 -0700 (PDT)
> > > X-Google-Token: Xp0zDQwAAAAdJHXmGGGzHt1StOx8D9ZY
> > > Received: from 200.186.157.114 by 38g2000cwa.googlegroups.com with HTTP;
> > > Mon, 22 May 2006 15:33:57 +0000 (UTC)
> > > From: "rodiniz" < [EMAIL PROTECTED]>
> > > To: "Ajax.NET Professional" <[email protected]>
> > > Subject: Re: Wierd Session Problem
> > > Date: Mon, 22 May 2006 08:33:57 -0700
> > > Message-ID:
> <[EMAIL PROTECTED]>
> > > In-Reply-To: <
> [EMAIL PROTECTED]>
> > > References: <
> [EMAIL PROTECTED]>
> > >
> <[EMAIL PROTECTED]>
> > > User-Agent: G2/0.2
> > > X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
> .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
> > > Mime-Version: 1.0
> > > Content-Type: text/plain
> > >
> > > Hi Michael .
> > > Even a simple "Hello world" using ajax returns a error 500 when I put
> > > the session handling code in the event.(wich has nothing to do with
> > > ajax)
> > > The code works fine on all pages that are not using ajax, so is not a
> > > problem with that code.
> > >
> > >
> > > > > >
> > >
> >
> >
> > --
> > Best regards | Schöne Grüße
> > Michael
> >
> > Microsoft MVP - Most Valuable Professional
> > Microsoft MCAD - Certified Application Developer
> >
> > http://weblogs.asp.net/mschwarz/
> > http://www.schwarz-interactive.de/
> > mailto:[EMAIL PROTECTED]
> >
>
>
>
--
Best regards | Schöne Grüße
Michael
Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer
http://weblogs.asp.net/mschwarz/
http://www.schwarz-interactive.de/
mailto:[EMAIL PROTECTED]
X-Google-Language: ENGLISH,ASCII
Received: by 10.54.131.8 with SMTP id e8mr202613wrd;
Mon, 22 May 2006 11:35:37 -0700 (PDT)
Return-Path: <[EMAIL PROTECTED]>
Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.196])
by mx.googlegroups.com with ESMTP id
v11si1118090cwb.2006.05.22.11.35.36;
Mon, 22 May 2006 11:35:37 -0700 (PDT)
Received-SPF: pass (googlegroups.com: domain of [EMAIL PROTECTED] designates
66.249.82.196 as permitted sender)
DomainKey-Status: good (test mode)
Received: by wx-out-0102.google.com with SMTP id s15so627019wxc
for <[email protected]>; Mon, 22 May 2006 11:35:36 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s¾ta; d=gmail.com;
h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
b=eKf89NNNINItyNJMgPeUhnInwgGIJjghZxDsHlJrPDx952px36/PS2Waaw56RGFfmtFiA8yU/G2UaYoMNOi6/ddMRxekeahl+U+0r6fp93NklQpkbkhUa8hO2iHj0u5YgQfOHBgVC10YXRSAEZrnHpLvrazfxa0rcjW8d1JlPOgReceived:
by 10.70.59.13 with SMTP id h13mr5459114wxa;
Mon, 22 May 2006 11:35:35 -0700 (PDT)
Received: by 10.70.89.1 with HTTP; Mon, 22 May 2006 11:35:35 -0700 (PDT)
Message-ID: <[EMAIL PROTECTED]>
Date: Mon, 22 May 2006 20:35:35 +0200
From: "Michael Schwarz" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: "Ajax.NET Professional" <[email protected]>
Subject: Re: [ajaxpro] Re: Wierd Session Problem
In-Reply-To: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
Hi,
have no Visual Studio here, but this will be wrong. Change following
lines in the WebForm1.aspx.cs:
Before:
private void Page_Load(object sender, System.EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(this.GetType());
// Put user code to initialize the page here
}
After:
private void Page_Load(object sender, System.EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(typeof(WebForm1));
// Put user code to initialize the page here
}
In the JavaScript part use following code:
<script type="tex/javascript">
<!--
function SayHello_callback(res) {
if(res.error == null) {
$("Resp").innerHTML = res.value;
} else {
$("Resp").innerHTML= res.error.Message;
}
}
function SayHello() {
SampleAjaxPro.WebForm1.HelloWorld(SayHello_callback);
}
//-->
</script>
Did you had a look at the example files?
Regards,
Michael
On 5/22/06, Rodrigo Diniz <[EMAIL PROTECTED]> wrote:
>
> Hi MIchael I built a simple project to show the error..
> I tried to use Ajax.net pro instead Ajax.net also, and it returns a
> different error message.
> If you comment out the simple line
> Session["hello"]="world";
> and recompile the project everithing works as expected..,.
> Please help me ...this is urgent.
>
>
> On 5/22/06, Michael Schwarz <[EMAIL PROTECTED]> wrote:
> > Can you please send me the project?? Maybe you have an example project
> > which is not working, too.
> >
> > Regards,
> > Michael
> >
> >
> > On 5/22/06, rodiniz <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi Michael .
> > > Even a simple "Hello world" using ajax returns a error 500 when I put
> > > the session handling code in the event.(wich has nothing to do with
> > > ajax)
> > > The code works fine on all pages that are not using ajax, so is not a
> > > problem with that code.
> > >
> > > X-Google-Language: ENGLISH,ASCII-7-bit
> > > Received: by 10.11.53.63 with SMTP id b63mr126852cwa;
> > > Mon, 22 May 2006 08:33:57 -0700 (PDT)
> > > X-Google-Token: Xp0zDQwAAAAdJHXmGGGzHt1StOx8D9ZY
> > > Received: from 200.186.157.114 by 38g2000cwa.googlegroups.com with HTTP;
> > > Mon, 22 May 2006 15:33:57 +0000 (UTC)
> > > From: "rodiniz" < [EMAIL PROTECTED]>
> > > To: "Ajax.NET Professional" <[email protected]>
> > > Subject: Re: Wierd Session Problem
> > > Date: Mon, 22 May 2006 08:33:57 -0700
> > > Message-ID:
> <[EMAIL PROTECTED]>
> > > In-Reply-To: <
> [EMAIL PROTECTED]>
> > > References: <
> [EMAIL PROTECTED]>
> > >
> <[EMAIL PROTECTED]>
> > > User-Agent: G2/0.2
> > > X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
> .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
> > > Mime-Version: 1.0
> > > Content-Type: text/plain
> > >
> > > Hi Michael .
> > > Even a simple "Hello world" using ajax returns a error 500 when I put
> > > the session handling code in the event.(wich has nothing to do with
> > > ajax)
> > > The code works fine on all pages that are not using ajax, so is not a
> > > problem with that code.
> > >
> > >
> > > > > >
> > >
> >
> >
> > --
> > Best regards | Schöne Grüße
> > Michael
> >
> > Microsoft MVP - Most Valuable Professional
> > Microsoft MCAD - Certified Application Developer
> >
> > http://weblogs.asp.net/mschwarz/
> > http://www.schwarz-interactive.de/
> > mailto:[EMAIL PROTECTED]
> >
>
>
>
--
Best regards | Schöne Grüße
Michael
Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer
http://weblogs.asp.net/mschwarz/
http://www.schwarz-interactive.de/
mailto:[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---