Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tab control 1

Status
Not open for further replies.

critical5

Programmer
Dec 13, 2006
37
GB
Hi I have an equivalent code in VB.NET for a window form but I would like to do the same using a web form.

What this code do is to create tab, labels and other controls programatically depending on certain situations....could someone help?

I could post the code if that is necessary!!

Thanks
 
At first glance, I would think about using 2 panel controls. One to contain the Tabs and one right below it to contain the tab content. Then you can fill the panels with your programmatically created controls by using "panel1.Controls.Add".

Alternatively, there may be a third party custom control available for this somewhere... but those can get spendy.


Senior Software Developer
 
I still do not understand this...Anyway partly i did not ask the right questions:

All I need to do is display the results which are a credit reposrt of an applicant. This will include an address details, names, aliases, and others. Ideally I would like to have titles and when a user clicks it it would display the contents. Tabs would be useful( Which control to use on web forms to dispplay a tab??)

I have tried to use a panel and a lot of labels but it looks shabby....Could someone give me an idea of a plan to use?

I would be grateful if someone could help?

Thanks

Critical5
 
This seems to be more of a html/asp problem,

I know that people have done this kind of thing with javascript, where you have a container(div) and have other containers with the labels/text-boxes, then have links running a java sub to hide the other containers and show the one you want. Something LIKE the following:
Code:
... Header code
  <script language="javascript">
    function ShowPanel(Panel){
    Panel1.Visible = False;
    Panel2.Visible = False;
    Panel3.Visible = False;
    Panel.Visible = True;
    }
  </script>
  <form onload="ShowPanel(Panel1)" .....>
....
    <div style="Width: 500px; Height: 400px">
      <a onclick="ShowPanel(Panel1)">Panel 1</a>
      <a onclick="ShowPanel(Panel2)">Panel 2</a>
      <a onclick="ShowPanel(Panel3)">Panel 3</a>
      <div id="Panel1" style="Width: 500px; Height: 375px">

... YOUR Labels/Text for panel 1 here

      </div>
      <div id="Panel2" style="Width: 500px; Height: 375px">
... YOUR Labels/Text for panel 2 here
      </div>
      <div id="Panel3" style="Width: 500px; Height: 375px">
... YOUR Labels/Text for panel 3 here
      </div>
    </div>
.... Rest of html code
  </form>
This hasn't been tested.

So with some code like this, you can create your labels and text-boxes with runat=server and set them like normal in you vb/asp code, then the user will have the option of clicking the links to see the other 'tabs'. To adapt from this you could create some graphics to represent the buttons and one for the background and have it looking like a normal tab object.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top