There are a lot of samples how to create tabbed view for list forms or webparts in SharePoint. Mostly they are build up with javascript, ajax or jquery. Well these technologies are really interesting, but today i am gonna make a short example of creating such tabbed views in c# using asp.net.
The advantages are crystal clear: If you have a form with lots of fields you can group them into tabs and the user
- see the section important fields
- does not need to scroll really deep
- have all fields in the scope of his or her eyes
Ok, let’s start with a simple application page which we add to our project solution. I recently builded the demo based on this post.
In this application page we insert in the aspx file the following code into the placeholder main:
[sourcecode language=”csharp”]
[/sourcecode]
Here we define the menu which appears as tabs. You can choose your own image and your style as well as your text.
[sourcecode language=”csharp”]
TAB VIEW 1
INSERT YOUR CONENT IN HERE
CHANGE SELECTED IMAGE URL AS NECESSARY
TAB VIEW 2
INSERT YOUR CONENT IN HERE
CHANGE SELECTED IMAGE URL AS NECESSARY
TAB VIEW 3
INSERT YOUR CONENT IN HERE
CHANGE SELECTED IMAGE URL AS NECESSARY
[/sourcecode]
In this multiview you can add your content which should appear in the tabs.
[sourcecode language=”csharp”]
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
MultiView1.ActiveViewIndex = Int32.Parse(Menu1.SelectedValue);
}
[/sourcecode]
This code snippet acts if you click on one of the tabs. In order to change the tab view.
The result should look like this:
Hope this helps. It won’t win a price for being pretty, but it just shows set it up. The styling and the content is up to you now.
..:: I LIKE SHAREPOINT ::..
Leave a Reply