I want to create a dynamic, role-based tab control that doesn't trigger a postback when the user switches between tabs. Does anyone have any suggestions on approaches to accomplish this?
views:
65answers:
3
+2
A:
You can use the ASP.NET AJAX Control Toolkit It has a tab control that is fully configurable and will not postback.
Scott Lance
2010-08-05 18:19:00
Thanks Scott, I am using AjaxCotnrolToolkit and my code is like thisFor i = 0 To 4 Dim tbpanel As New AjaxControlToolkit.TabPanel() tbpanel.HeaderText = "Text Tab" tbpanel.ID = "Tab" tbpanel.Controls.Add(New TextBox()) TabContainer1.Tabs.Add(tbpanel) Next ibut when i run my application it's not displaying any thing on web page.
2010-08-05 18:23:56
@user412260: Make sure that you are dynamically creating your panels in the Page_PreInit instead of Page_Load or Page_Init. The reason is that the OnInit for the TabContainer fires earlier than either Page_Load or Page_Init. Because of this if you add panels to the container after PreInit they will not be visible on your page.
Scott Lance
2010-08-05 18:58:32
@user412260: Also your Tab Panels all have the same ID, so you will need to do something like tbpanel.ID = "Tab" + i.ToString(). Having Tab Panels the same ID will prevent the tabs from being shown.
Scott Lance
2010-08-05 19:10:53
Thanks Scott, issue is resolved.
2010-08-05 19:27:18
A:
Have you considered using a javascript tab control? Ext-js has a whole suite of UI controls. Of course you'd have to write some web services and use (probably) jQuery to interact with them, but it would all be done without postbacks
Adam
2010-08-05 18:21:28
A:
Joel Coehoorn
2010-08-05 18:25:48