Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ASP.NET AJAX and the QueryString

18 views
Skip to first unread message

Christian Nunciato

unread,
Mar 21, 2007, 3:20:13 PM3/21/07
to
Hi there:

I'm using ASP.NET AJAX and liking it, but I've run into an issue I'm not
sure how to address.

I'm building a very simple image browser I'm sure you've all seen before --
one asp:Image tag and a couple of Next/Previous LinkButtons -- and
everything's working just fine, but of course, since we're not doing
full-page refreshes, the URL in the Address bar never changes -- it simply
remains Photo.aspx, for instance. I'd like to be able to set either a
QueryString parameter that the user can copy and pass around to others,
allowing the recipient to click the link and jump right to the image the
sender intended her to see.

Any out-of-the-box way to address this? In pure JavaScript plus handcrafted
Ajax, I think I could do it, but I'm wondering whether there's a way to do it
properly in the ASP.NET AJAX world.

Thanks much in advance!

Chris

Masudur

unread,
Mar 22, 2007, 2:30:10 AM3/22/07
to
On Mar 22, 1:20 am, Christian Nunciato

Hi...

I also suffered from this problem.... my problem was supporting back
button.... of the browser...

Check out this link...

http://www.nikhilk.net/UpdateControls.aspx

nikhil is providing us a very good way to encapsulate all the stuff
you said...

UpdateHistoryControl.... is non visible control... and provide the
back button support :)

and unique url as welll

Hope this help...

Thanks...
Masudur
http://www.kaz.com.bd
http://munnacs.blogspot.com

darrel

unread,
Mar 22, 2007, 2:02:53 PM3/22/07
to
> I'm building a very simple image browser I'm sure you've all seen
> before --
> one asp:Image tag and a couple of Next/Previous LinkButtons -- and
> everything's working just fine, but of course, since we're not doing
> full-page refreshes, the URL in the Address bar never changes -- it simply
> remains Photo.aspx, for instance. I'd like to be able to set either a
> QueryString parameter that the user can copy and pass around to others,
> allowing the recipient to click the link and jump right to the image the
> sender intended her to see.

This is the drawback to AJAX and flash and the like.

There's not a huge reason to put your slide show into AJAX. The easiest
solution may be to simply not use AJAX for this.

Otherwise, I'd suggest creating a permalink type of link. Have this link
update with each image via AJAX and give it the appropriate querystring.

-Darrel


Christian Nunciato

unread,
Mar 22, 2007, 10:31:11 PM3/22/07
to
Hi Darrel:

Thanks for the reoly. I only posted because I wanted to know how to handle
the situation *in* ASP.NET AJAX, or of there was a way. It wasn't a "should
I" kind of question on application design -- it was a how-to question.

But thanks for the input anyway.

Chris

Christian Nunciato

unread,
Mar 22, 2007, 10:33:05 PM3/22/07
to
Awesome, thanks Masudur!

darrel

unread,
Mar 23, 2007, 10:19:08 AM3/23/07
to
> Thanks for the reoly. I only posted because I wanted to know how to
> handle
> the situation *in* ASP.NET AJAX, or of there was a way. It wasn't a
> "should
> I" kind of question on application design -- it was a how-to question.

Understood, but, again, it's like asking how do I build a house with a
spatula? There really isn't a proper way TO build a house with a spatula.
It's the wrong tool for the job.

AJAX is a tool to be used as a part of a web site. It's great for some
things...not so great for others.

Now, I haven't used the 'updateHistory' control mentioned, but I find it
hard to believe that it can change the URL of the page, as that's a major
security flaw in the browser if so (come to think of it, I'd argue that
messing with the back button is a problem, too, though I realize it's
doable). So, you're still left with not being able to bookmark a specific
image, which I think is your ultimate goal.

As such, the answer I gave you would probably accomodate your need (create a
permalink on the page itself).

-Darrel


0 new messages