Visual Basic .NET » ASP.NET General Discussion
Angry, frustrated, about to give up. Has anyone gotten AJAX .NET to work in .NET 2.0? -- Michael Schwarz --


Hi,

you cannot use document.write, use something like document.getElementById(...) and the .innerHTML property. Or replace you document.write statement with an alert and you are fine. If you are using AjaxPro you have to write JavaScript code. You have to do this every time you want to write great web sites!

Regards,
Michael

On 7/5/06, Jeremy wrote:

Hello all,

I'm having a very difficult time getting started with AJAX .NET, and
I'm about to give up. I've read both Joseph Guadagno's documentation
material as well as the "Quick Guide" written by the author of the AJAX
.NET library. Neither have been a whole lot of help. I can see from
some of the questions in this group that others have found a way to
create apps with AJAX .NET. For the life of me, I can't imagine how
they figured out how to do this.

All I want to do is pull some text from the server and output it in
JavaScript. I imagine that this is one of the simplest things you can
do in AJAX. I just want to have a single function in my page class
that returns a string, and I want to pull this string from my webpage
without having to do a full page refresh. Yet, try as I might, I just
can't get it to work.

Everything compiles fine, but the method in my page class never fires.
I'm really at a loss here. I've tried to dissect the examples in the
various starter kits, but this has led me nowhere. The starter kits
are too complex, and involve a bunch of complex JavaScript that I don't
understand. I'm trying to do something really easy, and nowhere in the
starter kits does anybody accomplish what I'm trying to do without
doing a bunch of fancy stuff (as in the Interval example).

Here is the code in my aspx.cs :


public partial class TryAgain : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(TryAgain));
}


public string GetString()
{
return "Hi dee ho!";
}
}

Here is the javascript code that I embedded in my .aspx :



I have tried many, many various permutations of this, and I get the
same problem every time. Inside my page class, my GetString() method
is never called. Does anybody know why this is happening?

Thank you for your help.
>

--  

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:info
[Submit Comment]Home