Welcome Guest Search | Active Topics | Sign In | Register

Use TabStrip to access various .aspx pages Options
rsaville
Posted: Sunday, November 11, 2007 11:54:52 AM
Rank: Member
Groups: Member

Joined: 11/3/2007
Posts: 12
I would like to use the TabStrip for site navigation. I see how to use a MultiPage control with child PageView controls to provide various set of UI controls per tab. I do not see how to associate a tab with an .aspx page on the site. I have been able to put an iFrame on a PageView with its "src" set to an .aspx page on the site, but is there a more direct way of doing this?
eo_support
Posted: Sunday, November 11, 2007 1:25:35 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Yes. You need to set each TabItem's NavigateUrl property. Note since you are navigating to different pages, it is necessary to:

1. Have the same TabStrip inside each page. This is usually done by using a master page;
2. Keep state information across pages. You need to either set AutoSelectSource to "NavigateUrl" or SaveStateCrossPages to true;

Thanks
rsaville
Posted: Sunday, November 11, 2007 1:45:51 PM
Rank: Member
Groups: Member

Joined: 11/3/2007
Posts: 12
Does your technique use PageViews?

Is there an example of this in the demo projects?

I do not want to have a round trip to the server when the selected tab is changed. The user should be able to move between tabs with each tab's PageView contents unaltered. This would not be the case if I use the tabItems's NavigateUrl property, correct? This works properly when the PageView contains an iFrame.
eo_support
Posted: Sunday, November 11, 2007 3:04:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Either case it requires a HTTP GET from the server. The difference is whehter you are pulling the page to replace your whole window or pulling the page to be displayed inside the iframe. So there isn't a lot of difference between using iframe and not using iframe.

If you only have a few tabs/pages, your solution could be the best solution. However, if you have a large number of tabs, then you probably do not want to have so many PageViews/IFrames as they consume resources. In that case the easiest way for you is to use one iframe, then use some JavaScript to set the iframe's src when a tab item is clicked. To use this solution, you would need to:

1. Store the target Url into each tab item's Value property;
2. Handle the TabStrip's ClientSideOnItemClick event. Inside that event, you can do:

Code: JavaScript
function ontab_item_clicked(e, info)
{
    window.open(info.getItem().getValue(), "your_iframe_name");
}


Note if you use this way, everytime user clicks a tab, the page will be pulled from the server. If you use MultiPage/PageView, each page will only be pulled once.

Thanks
rsaville
Posted: Monday, November 12, 2007 11:46:12 AM
Rank: Member
Groups: Member

Joined: 11/3/2007
Posts: 12
I don't completely understand your reply. Let me ask specific questions:

1. By using an iFrame in each PageView with it's src = an .aspx page on the site, the user can switch between tabs repeatedly without any round trip to the server. I have verified this with a packet sniffer. If I use your suggested technique of using the each tabItem's NavigateUrl to target different .aspx on the site and have each target page duplicate the tabStrip, there will be a round trip every time the user changes tabs. Is this correct?

2. If #1 is correct, is there a way other than using iFrames to allow the user to change tabs with have a round trip to the server?


Thanks
eo_support
Posted: Monday, November 12, 2007 11:56:29 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
rsaville wrote:
I don't completely understand your reply. Let me ask specific questions:

1. By using an iFrame in each PageView with it's src = an .aspx page on the site, the user can switch between tabs repeatedly without any round trip to the server. I have verified this with a packet sniffer. If I use your suggested technique of using the each tabItem's NavigateUrl to target different .aspx on the site and have each target page duplicate the tabStrip, there will be a round trip every time the user changes tabs. Is this correct?

2. If #1 is correct, is there a way other than using iFrames to allow the user to change tabs with have a round trip to the server?


Thanks


#1 is correct. What I was trying to say is, The difference is not using iframe or not, the real difference is using MultiPage or not. When you use multipage, there is no round trip. When you do not use multipage, there will be round trips.

As for #2, I am assuming you are asking how to not use iframe to load a separate page and still do not have round trip to the server. Unfortunately, the answer is, as far as I know, no. IFrame is designed for this purpose and I am not sure if there are any other ways to do it without using iframe. Even if there was, I do not see any advantage of using that method over using iframes.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.