...
There's actually more posts about the design changes on this 'ere blog than actual stuff about Ajax. I should kick myself in the [...]. :/
Anyway, new design change, upgrade (?) to bloggerbeta so I can get at least a little tag cloud and a nicer template, hopefully real content will be appearing soon. haha!
A(synchronous) J(avascript) A(nd) X(ml) Tech
AJAX is *not* a cleaning liquid. It is *not* a soccer team. It is 4-letter acronym to a brand new technology making the internet rounds. [What, ajax is a cleaning liquid? Oh, soccer team too? What, it's not new? Oh, alright, I'll edit it...] AJAX is a 4-letter acronym making the internet rounds. Thank you.
Wednesday, November 22, 2006
Tuesday, June 27, 2006
Blargh
That's that, not going to change the design no more. Plenty of space for text and that's that. :p
and the design is going down...
Sorry about the weird design... haven't gotten a chance yet to redo the thing, so I'm happily hacking away at the default one so I can get a bit more space for the text :)
Stealthy Ajax for the .NET world, part I
So there are a few libraries out there to "connect" .NET and AJAX, one of the most popular being Ajax.NET. :p Still, the concept of putting code on the server-side to link up client-side script doesn't really do it for me, especially because I want to replace the traditional synchronous form postback with an asynchronous call, without touching my existing code. An interesting challenge...
Before I go into details about how to go about doing this, let me just spell out some of the problems to solve in this approach...
First, for the pages to run as-is, everything must appear cool to ASP.NET. You see, everytime you play around with something in an ASP.NET page, the most likely thing to happen is a postback... by default almost everything in a ASP.NET page provokes a post of the form, because that way it's easier to alter the page - showing or hiding stuff, loading combos, etc - in the code-behind. To plug-in ajax into this, we'll have to make sure the code-behind doesn't notice we're actually posting stuff programatically through ajax instead of allowing the form to auto-post itself.
Second, how do we deal with the return html? Because your page will not know that ajax did the posting, it will not return xml or any data format pretty enough to be manipulated in javascript. Oh no, it will return exactly what it would do if you allowed the form to post itself: HTML.
Now, you're thinking, "that's not so bad, we just take the html and plug it back to the user by doing a document.innerHTML = response or something, right?" Riiiight... that works... unless, of course, your nice page has javascript it wants the browser to run. Big oopsie.
Ya see, the page you're getting back is the same the browser would get directly, and of course, your nice web app might be outputting some nice script to load an array dinamically as you cycle through a repeater or something. Who knows! And that nice little script will come out in the middle of all that html that you will get in response to you ajax request, only when you show it to the user by writing it to the whateverHTML property of your document, it won't be executed. No siree. Isn't it fun? :)
So 2 nice little problems for us... making sure the ASP.NET engine doesn't notice we're doing the calling, and mimicking the behaviour of a browser by executing any scripts that are returned in the html.
This will be interesting... :)
Before I go into details about how to go about doing this, let me just spell out some of the problems to solve in this approach...
First, for the pages to run as-is, everything must appear cool to ASP.NET. You see, everytime you play around with something in an ASP.NET page, the most likely thing to happen is a postback... by default almost everything in a ASP.NET page provokes a post of the form, because that way it's easier to alter the page - showing or hiding stuff, loading combos, etc - in the code-behind. To plug-in ajax into this, we'll have to make sure the code-behind doesn't notice we're actually posting stuff programatically through ajax instead of allowing the form to auto-post itself.
Second, how do we deal with the return html? Because your page will not know that ajax did the posting, it will not return xml or any data format pretty enough to be manipulated in javascript. Oh no, it will return exactly what it would do if you allowed the form to post itself: HTML.
Now, you're thinking, "that's not so bad, we just take the html and plug it back to the user by doing a document.innerHTML = response or something, right?" Riiiight... that works... unless, of course, your nice page has javascript it wants the browser to run. Big oopsie.
Ya see, the page you're getting back is the same the browser would get directly, and of course, your nice web app might be outputting some nice script to load an array dinamically as you cycle through a repeater or something. Who knows! And that nice little script will come out in the middle of all that html that you will get in response to you ajax request, only when you show it to the user by writing it to the whateverHTML property of your document, it won't be executed. No siree. Isn't it fun? :)
So 2 nice little problems for us... making sure the ASP.NET engine doesn't notice we're doing the calling, and mimicking the behaviour of a browser by executing any scripts that are returned in the html.
This will be interesting... :)
Intro and waves
Alrighty, first and second posts are off, we can get down to business now :D
My name is Andreia Gaita, I'll be your host for this evening. *bows*. The nick is shana (or sh4na), btw, so if you call me out by that, I'll answer :)
(Almost) Everything you ever wanted to know about me (and some stuff you probably didn't) is proeminently displayed on my website, mirror here.
You can check out my other blog thing, World of Coding, where I delude myself into thinking I actually know what I'm talking about :p
I'm a programmer by trade, and I refuse to list languages because, well, then I would have to change this all the time :p
shana
gone crazy, back soon, leave message
My name is Andreia Gaita, I'll be your host for this evening. *bows*. The nick is shana (or sh4na), btw, so if you call me out by that, I'll answer :)
(Almost) Everything you ever wanted to know about me (and some stuff you probably didn't) is proeminently displayed on my website, mirror here.
You can check out my other blog thing, World of Coding, where I delude myself into thinking I actually know what I'm talking about :p
I'm a programmer by trade, and I refuse to list languages because, well, then I would have to change this all the time :p
shana
gone crazy, back soon, leave message
And again...
Now that we're all over this first post thing, let me just introduce this little space.
This yer' blog will serve as a repository for all those little things I come up with during my cleaning, soccer and coding times. Well, not cleaning or soccer really... just coding... ajax...
At least you can be sure all the code is spiffy clean :p
This yer' blog will serve as a repository for all those little things I come up with during my cleaning, soccer and coding times. Well, not cleaning or soccer really... just coding... ajax...
At least you can be sure all the code is spiffy clean :p
And...
Sigh...
First post.
Yes.
Really.
Interesting ain't it?
...
And now, back to our regular program...
First post.
Yes.
Really.
Interesting ain't it?
...
And now, back to our regular program...
Subscribe to:
Posts (Atom)