Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Navigation using XMLHTTPRequest

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roland Dick - 27 Oct 2007 10:21 GMT
Hi,

I have a website which has navigation links on the left. What I would
like to achieve is that a user clicks a link, the navigation bar stays
where it is and only the content gets loaded into a div; and all that
without using a frameset or an iframe. (It's a client's requirement..
you know how they are!)

Other sites do that as well: They create an XMLHTTPRequest object via JS
and write the resulting HTML (minus headers and footers) into a div. I
tried to do that and it works quite well - except for the "small"
drawback that the content ASP.NET page can not be used, i.e. clicks
trigger a postback as they should, but ASP.NET realizes that the
viewstate is wrong and throws an exception.

I'm not sure how other languages such as PHP do it, I suspect they
simply have several form tags on one page. Since you can't have two
ASP.NET forms and therefore two viewstates on a single page however, I'm
out of ideas how to solve that.

Anybody a pointer for me? :)

Thanks,

Roland
Peter Bromberg [C# MVP] - 27 Oct 2007 12:57 GMT
If you use a framework to do this such as Microsoft ASP.NET AJAX or
Anthem.Net, you can have your cake and eat it too.
-- Peter
Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com

> Hi,
>
[quoted text clipped - 21 lines]
>
> Roland
Roland Dick - 27 Oct 2007 13:54 GMT
Hi Peter,

thanks for your reply.

> If you use a framework to do this such as Microsoft ASP.NET AJAX or
> Anthem.Net, you can have your cake and eat it too.

I am not sure whether ASP.NET AJAX would help me in this situation.
After all, the navigation links are really links and therefore cause
another page to be loaded. If the link is inside say an updatepanel, it
causes the updatepanel including the menu to refresh. If the link is
outside the updatepanel, it causes the whole "new" page to be reloaded.

I am successfully using AJAX for the contentpages. It's just the
navigation that I'm struggling with, and I haven't seen a demo out so
far that has a feature of what I would like to achieve; even the toolkit
site http://asp.net/ajax/ajaxcontroltoolkit/samples/ reloads every time
you click on the navigation links on the left.

Am I missing something there?

Thanks,

Roland

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.