Home All Groups Group Topic Archive Search About

Tabbed control for ASP.NET pages

Author
11 Dec 2005 10:29 AM
jonefer
I'm a total Dotnet beginner, is there any example for creating the same kind
of Tabbed control for Windows Forms - such as in Yahoo mail?

Author
11 Dec 2005 2:58 PM
Keith Patrick
Look for samples of the Repeater and MultiView controls in MSDN.  The
repeater can be used to build your tabs, and the multiview can be used as
your tab pages with the same effect.
Author
11 Dec 2005 6:17 PM
jonefer
Thank you.  I looked through MSDN, but can't find MultiView.
Would you mind describing for me how you would do this with the repeater
control (I don't expect a totally coded example, I just need more
familiarization with this tool)- I've always pictured this tool as an
alternative to a data grid - kind of like a "continuous form view" in MS
Access when viewing multiple records.

I have a simple member search app that I made in MS Access and I want to
convert it to a browser app. - It seems fairly simple because I'm only
searching on 3 fields in a basically flat table.

Show quoteHide quote
"Keith Patrick" wrote:

> Look for samples of the Repeater and MultiView controls in MSDN.  The
> repeater can be used to build your tabs, and the multiview can be used as
> your tab pages with the same effect.
>
>
>
Author
12 Dec 2005 12:43 AM
agapeton
Here's a multiview...

<asp:MultiView id="mvMyPage" runat="server" ActiveViewIndex="0">
<asp:View id="vSelection" runat="server">
</asp:View>
<asp:View id="vData" runat="server">
</asp:View>
</asp:MultiView>

Your codebehind works like this...
        mvMyPage.SetActiveView(vData);

It's really simple...

Avoid the Wizard control at ANY cost...it does nothing but put tables
in your code.  Tables are evil for layouts.  The MultiView provides a
very clean, very manageable, and very customizable way to have more
than one "page" in a page in parallel.

That said...sounds like you want to check out the FormsView.  I've
hated all versions of Visual Studio from 4.0 till today...except VS2005
is AWESOME.  Let intellisense help you with the FormsView.  You can
also let intellisense help you with the coding against the MultiView,
but there's not much more to it than what I just showed you.

MSDN is loaded with this stuff.  I don't mean the sometimes incomplete
MSDN library, but the articles and columns.

Author
12 Dec 2005 2:28 AM
Keith Patrick
Another thing instead of the Repeater is a variation of the TreeView.  The
reason this is such a good control for a tab-based application is that it
can show a single level of a SiteMap (my favorite feature of ASP.Net 2.0,
BTW), styled as "tab buttons".  If you organize your sitemap in terms of of
functional layers, your tabs (treeview with its datasource's databinding
level set to 1 with no root) can use the sitemap as its datasource, and you
can feed the sitemap's subtrees to a single control that reads
hierarchicaldatasource's rather than use MultiView and have a more scaleable
application in terms of being maintenance-free when adding content to the
sitemap.