473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Can you add a System.Web.UI.UserControl to AJAX TabPanel?

Hi. I'm trying to add a System.Web.UI.UserControl (Not a
System.Web.UI.WebControl) to an asp.net ajax tabpanel.

Unfortunately it doesn't appear that this is possible. This question could
get very detailed, but I'll keep it short. I have a subroutine shown below
which adds a tabpanels to a tabcontainer(Tabs1) based for each object in a
collection. Then for each tabpanel I try to add a usercontrol named
uWebPage. But when the Page_Load event for uWebPage fires I get null
reference exceptions when referencing controls on uWebpage.

Is this situation I'm trying (adding usercontrol to tabpanel) even possible?
Thanks!
------------------------------------------------------------------------------
Dim oNewTab As AjaxControlToolkit.TabPanel
Dim uWebpage As uWebpage

For Each oAssociation As UserVideoAssociation In oAssociations
For Each oWebpage As Webpage In oAssociation.Webpages
oNewTab = New AjaxControlToolkit.TabPanel

uWebpage = New uWebpage
uWebpage.DomainName = oAssociation.DomainName
uWebpage.Webpage = oWebpage.Webpage

oNewTab.Controls.Add(uWebpage)

oNewTab.HeaderText = oWebpage.Webpage
Tabs1.Tabs.Add(oNewTab)
Next
Next
------------------------------------------------------------------------------
Dec 1 '07 #1
2 2345
Howdy,
Howdy,

Dynamic user controls require a call to LoadControl method instead of
constructor:

For Each oAssociation As UserVideoAssociation In oAssociations
For Each oWebpage As Webpage In oAssociation.Webpages

oNewTab = New AjaxControlToolkit.TabPanel

uWebpage = CType(LoadControl("locationoftheusercontrol"), uWebpage)
uWebpage.DomainName = oAssociation.DomainName
uWebpage.Webpage = oWebpage.Webpage

oNewTab.Controls.Add(uWebpage)

oNewTab.HeaderText = oWebpage.Webpage
Tabs1.Tabs.Add(oNewTab)
Next
Next

Hope this helps
--
Milosz
"Mike" wrote:
Hi. I'm trying to add a System.Web.UI.UserControl (Not a
System.Web.UI.WebControl) to an asp.net ajax tabpanel.

Unfortunately it doesn't appear that this is possible. This question could
get very detailed, but I'll keep it short. I have a subroutine shown below
which adds a tabpanels to a tabcontainer(Tabs1) based for each object in a
collection. Then for each tabpanel I try to add a usercontrol named
uWebPage. But when the Page_Load event for uWebPage fires I get null
reference exceptions when referencing controls on uWebpage.

Is this situation I'm trying (adding usercontrol to tabpanel) even possible?
Thanks!
------------------------------------------------------------------------------
Dim oNewTab As AjaxControlToolkit.TabPanel
Dim uWebpage As uWebpage

For Each oAssociation As UserVideoAssociation In oAssociations
For Each oWebpage As Webpage In oAssociation.Webpages
oNewTab = New AjaxControlToolkit.TabPanel

uWebpage = New uWebpage
uWebpage.DomainName = oAssociation.DomainName
uWebpage.Webpage = oWebpage.Webpage

oNewTab.Controls.Add(uWebpage)

oNewTab.HeaderText = oWebpage.Webpage
Tabs1.Tabs.Add(oNewTab)
Next
Next
------------------------------------------------------------------------------
Dec 1 '07 #2
Awesome! Thank you so much!

"Milosz Skalecki [MCAD]" wrote:
Howdy,
Howdy,

Dynamic user controls require a call to LoadControl method instead of
constructor:

For Each oAssociation As UserVideoAssociation In oAssociations
For Each oWebpage As Webpage In oAssociation.Webpages

oNewTab = New AjaxControlToolkit.TabPanel

uWebpage = CType(LoadControl("locationoftheusercontrol"), uWebpage)
uWebpage.DomainName = oAssociation.DomainName
uWebpage.Webpage = oWebpage.Webpage

oNewTab.Controls.Add(uWebpage)

oNewTab.HeaderText = oWebpage.Webpage
Tabs1.Tabs.Add(oNewTab)
Next
Next

Hope this helps
--
Milosz
"Mike" wrote:
Hi. I'm trying to add a System.Web.UI.UserControl (Not a
System.Web.UI.WebControl) to an asp.net ajax tabpanel.

Unfortunately it doesn't appear that this is possible. This question could
get very detailed, but I'll keep it short. I have a subroutine shown below
which adds a tabpanels to a tabcontainer(Tabs1) based for each object in a
collection. Then for each tabpanel I try to add a usercontrol named
uWebPage. But when the Page_Load event for uWebPage fires I get null
reference exceptions when referencing controls on uWebpage.

Is this situation I'm trying (adding usercontrol to tabpanel) even possible?
Thanks!
------------------------------------------------------------------------------
Dim oNewTab As AjaxControlToolkit.TabPanel
Dim uWebpage As uWebpage

For Each oAssociation As UserVideoAssociation In oAssociations
For Each oWebpage As Webpage In oAssociation.Webpages
oNewTab = New AjaxControlToolkit.TabPanel

uWebpage = New uWebpage
uWebpage.DomainName = oAssociation.DomainName
uWebpage.Webpage = oWebpage.Webpage

oNewTab.Controls.Add(uWebpage)

oNewTab.HeaderText = oWebpage.Webpage
Tabs1.Tabs.Add(oNewTab)
Next
Next
------------------------------------------------------------------------------
Dec 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: quelle | last post by:
I have a TabContainer with three TabPanels. What I'd like to do is call a javascript function (with some custom parameters) every time a tab is clicked. Here is a simplified example: ...
0
by: vincent.defarge | last post by:
hi, I have a page that contains a tabpanel and a button which allow to change the mode of my tabpanel. my tabpanel has 2 modes : -"all elements disabled" -"all elements enabled" The tabpanel...
0
by: fran_j_diaz | last post by:
Hi, I've got some web pages whiches are too heavy. My pages have TabPanels and I saw that it was possible to load a tabPanel when we click in instead of the page loading. I went to ...
0
by: tutus | last post by:
Hi, related to Asp.net Ajax Control Toolkit: In a TabContainer with two tabPanels, when I click on the second TabPanel, how can I cancel the TabPanel change event (or the TabPanel change...
2
by: NvrBst | last post by:
Anyone know how to force the Tab Panel to the remaining height of the page? "<cc1:TabPanel ...>" has a height option but only accepts pixels. My page goes <body><form...
1
by: mistryman06 | last post by:
Hi, I'm new to the ASP.NET Ajax. Im struck with an issue. Im having a tabcontainer with 3 tabs. Each tab has a user control (all 3 tab has the same user control) & the user control has a Button &...
1
by: raam | last post by:
Hi, I have ajax tab container with 6 tabs in it. I need to validate each tab contents separately and the validtaion summary must be separate for each tab. i cannot do that only one summary is...
1
by: E11esar | last post by:
Hi there. I have created an asp.net page with C# and have added two tabs using the respective AJAX control. I am trying to add a table within an AJAX Accordion control in the second tab but I am...
5
by: temijojo | last post by:
Hello, Can someone help me in this problem. In my content page, I used 2 user controls inside an Ajax Toolkit TabControl. One of the user controls is a data entry with a dropdownlist. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.