Home arrow ASP.NET arrow Page 3 - IE Web Controls in VB.NET

IE Web Controls in VB.NET

The web interface is becoming more advanced...In this article Himanshu shows us a simple example of how to use the TreeView and TabStrip IE Web Controls with VB.NET.

Author Info:
By: Himanshu Dhami
Rating: 4 stars4 stars4 stars4 stars4 stars / 51
February 25, 2003
  1. · IE Web Controls in VB.NET
  2. · TreeView Control
  3. · TabStrip Control
  4. · Conclusion

print this article

IE Web Controls in VB.NET - TabStrip Control
(Page 3 of 4 )

Now letís look at how to use the TabStrip control.

The code in the ASPX file is similar to the code for TreeView control, here it is:

<iewc:tabstrip id=mytabstrip accessKey="<%# Page %>" runat="server" Width="338px" Height="28px" AutoPostBack="True" TabSelectedStyle="background-color:#ffffff;color:#000000;" TabHoverStyle="background-color:#777777;" TabDefaultStyle="background-color:#668274;font-family:verdana;font-weight:bold;font-size:8pt;color:#ffffff;width:79;height:21;text-align:center;">
   <iewc:Tab Text="tab1"></iewc:Tab>
   <iewc:Tab Text="tab2"></iewc:Tab>
   <iewc:Tab Text="tab3"></iewc:Tab>
   <iewc:Tab Text="tab4"></iewc:Tab>

The code above will create 4 tabs in the page. Now comes time to add functionality to these tabs.

The most common functionality which we have seen in something like this is that a user clicks different tabs and pages corresponding to the tabs are displayed to the user. I was trying to implement this TabStrip for similar functionality in my project but I was disappointed to see that there is not property or method like Treenode.NavigateUrl. So I created an iframe in the page like this:

<iframe id=applnname style="WIDTH: 100.33%; HEIGHT: 175.81%" hspace=0 vspace=0 src="<%=sIFrameSrc%>" frameBorder=no height="100%">

This src="<%=sIFrameSrc%>" is important as in the code behind page we will populate frame source so that we can get required functionality of switching between different pages.

When you click on different tabs mytabstrip_onSelectedIndexChange is called so this is the place where we can change srcframe to different pages.

Private Sub mytabstrip_onSelectedIndexChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles mytabstrip.SelectedIndexChange
  Dim sdata As String
  Select Case mytabstrip.SelectedIndex
    Case 0
      tabname = "tab1"
      sIFrameSrc = "http://www.oxx.no"
    Case 1
      tabname = "tab2"
      sIFrameSrc = "http://www.yahoo.co,"
    Case 2
      tabname = "tab3"
      sIFrameSrc = "your choice"
    Case Else
      sIFrameSrc = "http://www.oxx.no"
  End Select
End Sub

You should now be able to set up a working TabStrip on your page. The code I have provided is very simple but these controls can be utilized in many applications.
blog comments powered by Disqus

- How Caching Means More Ca-ching, Part 2
- How Caching Means More Ca-ching, Part 1
- Reading a Delimited File Using ASP.Net and V...
- What is .Net and Where is ASP.NET?
- An Object Driven Interface with .Net
- Create Your Own Guestbook In ASP.NET
- HTTP File Download Without User Interaction ...
- Dynamically Using Methods in ASP.NET
- Changing the Page Size Interactively in a Da...
- XML Serialization in ASP.NET
- Using Objects in ASP.NET: Part 1/2
- IE Web Controls in VB.NET
- Class Frameworks in VB .NET
- Cryptographic Objects in C#: Part 1
- Sample Chapter: Pure ASP.Net

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials