Home All Groups Group Topic Archive Search About

Problem programmatically creating tabstrip webcontrol

Author
6 Apr 2005 8:29 AM
Nasir Mansoor via DotNetMonster.com
I am trying to programmatically build a tabstrip (creating a template
class for my site that contains a tabstrip in the header).  I'm using
the tabstrip from "Microsoft.web.ui.webcontrol" (iewebcontrols). Now my
problem is how to add HTML for this control to my asp.net page using
literalControls?

--
Message posted via http://www.dotnetmonster.com

Author
6 Apr 2005 9:32 AM
MasterGaurav
Just do

Page_Load(...)
{
   Initialize(your_tab_strip_control);
   Controls.Add(your_tab_strip_control);
}

HTH


CHeers,
Gaurav Vaish
http://mastergaurav.org
http://mastergaurav.blogspot.com
----------------------------
Author
7 Apr 2005 8:46 AM
Nasir Mansoor via DotNetMonster.com
Thanks for ur reply. but now problem is how to catch its event i tried

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load


      DrawTabStrip()
      AddHandler MyTabStrip.SelectedIndexChange, AddressOf
MyTabStrip_SelectedIndexChange

End Sub

Private Sub MyTabStrip_SelectedIndexChange(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles
TabStrip1.SelectedIndexChange

        If MyTabStrip.SelectedIndex = 0 Then
            Response.Write("A")
        Else
            Response.Write("B")
        End If

End Sub

but it gives an error "__myTabStrip_State__" is undefined.

it draws it after end of HTML tag...

</HTML>
<?XML:NAMESPACE PREFIX="TSNS" /><?IMPORT NAMESPACE="TSNS"
IMPLEMENTATION="WebControl/1_0/tabstrip.htc" />
<TSNS:TabStrip id="MyTabStrip" ...

Now Please tell me how to capture the events...

--
Message posted via http://www.dotnetmonster.com