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.

UpdatePanel and navigation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roland Dick - 22 Oct 2007 15:48 GMT
Hi,

this must have been asked a thousand times, but for some reason I
couldn't find anything on this..

I have an ASP.NET 2 website with a masterpage, which contains some
navigation links (partially created from a database at runtime,
partially static). What I want to achieve is that when the user clicks a
link, the ContentTemplate gets reloaded to display the new content but
the navigation links should not be re-created (i.e. avoid flicker).

Sounded like an updatepanel to me, but if the updatepanel spans around
the navigation, the navigation gets refreshed obviously; and if the
updatepanel only spans around the ContentTemplate, then the navigation
links are outside the updatepanel, causing a full post-back. Triggers
didn't help either..

There must be an easy solution and I'm just blind.. can anyone shed some
light on this?

Cheers,

Roland
Mark Rae [MVP] - 22 Oct 2007 15:52 GMT
> this must have been asked a thousand times, but for some reason I couldn't
> find anything on this..
[quoted text clipped - 13 lines]
> There must be an easy solution and I'm just blind.. can anyone shed some
> light on this?

Sounds like you're confusing MasterPages with framesets...

A MasterPage is nothing more than a particular kind of UserControl. When you
open a content page, it simply uses the MasterPage to provide common look
and feel. Moving from one content page to another content page is no
different from moving from a "normal" aspx page to another "normal" aspx
page...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Roland Dick - 22 Oct 2007 16:46 GMT
Hi Mark,

Mark Rae [MVP] schrieb:
 > Sounds like you're confusing MasterPages with framesets...

Thanks for your reply, much appreciated. Yes, I know the MasterPages
concept. I'm somewhat new to the AJAX Control Toolkit though and thought
the UpdatePanel would help me solve this problem. I think the situation
would be the same without MasterPages and the navigation being static in
each page.

What would be a proper solution to avoid re-loading the navigation then
(as obviously framesets are.. let's say outdated :) )

Cheers,

Roland
Mark Rae [MVP] - 22 Oct 2007 16:56 GMT
> I think the situation would be the same without MasterPages and the
> navigation being static in each page.

Yes it would - navigation is navigation i.e. moving from one page to another
page. Callbacks (i.e. AJAX in this case) don't involve navigation...

> What would be a proper solution to avoid re-loading the navigation then
> (as obviously framesets are.. let's say outdated :) )

I'm slightly confused as to what you're trying to achieve here... When you
move from page1.aspx to page2.aspx, page2.aspx is going to have to load from
scratch...

If you're trying to simulate the same sort of functionality as framesets,
this might work if all your pages are .htm - you could open them with
System.IO, strip off the <html>, <head> and <body> tags and squirt what's
left into a <div>...

Alternately, maybe an <iframe> would work.

Sounds like you're making life difficult for yourself with no discernible
(IMO!) benefit...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Roland Dick - 22 Oct 2007 17:09 GMT
Hi Mark,

Mark Rae [MVP] schrieb:

> Sounds like you're making life difficult for yourself with no
> discernible (IMO!) benefit...

Yeah, that might be true. Well, the main benefit would be that clicking
a link in the navigation wouldn't cause DB queries to run (which fill
some of the navigation bar).
But I think I could as well cache the data.

Thanks for your help!

Roland
Mark Rae [MVP] - 22 Oct 2007 17:15 GMT
>> Sounds like you're making life difficult for yourself with no discernible
>> (IMO!) benefit...
[quoted text clipped - 3 lines]
> of the navigation bar).
> But I think I could as well cache the data.

That would definitely be the way to go if your navigation is at least static
per session...

Presumably, the links are different per (type of) user, otherwise you'd just
hardcode them, right...?

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Roland Dick - 24 Oct 2007 12:17 GMT
Hi Mark,

Mark Rae [MVP] schrieb:
> Presumably, the links are different per (type of) user, otherwise you'd
> just hardcode them, right...?

No, in that case I would use a LoginView control and still hardcode the
links in the according rolegrouptemplate; the links are from a database
where articles are stored, and for example the 10 most popular articles
should be displayed in the navigation under a "products" collapsible
panel (together with a static "All products" link).

The other problem is that the links cause not just a postback but a
reload of the page, making the collapsible panels loose their state. But
that is a different story...

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.