.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Findcontrol inside Tabcontainer

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :ASP.Net


I hope someone can help with this simple problem...

Dim imagephoto As Image = CType(TabContainer1.FindControl("imgPhoto"), Image)

I'm trying to use the above code to find an image inside a formview inside a tabcontainer inside a webform. But this isn't working for some reason. The spelling is correct, but it's not finding the control.

What am I missing?



View Complete Post

More Related Resource Links

Modifing ".ajax__tab_xp-theme" for "ajaxToolkit:TabContainer" inside asp:wizard known issues ???


This Post comes  from: http://forums.asp.net/p/1609311/4116646.aspx#4116646 


I'm using ASP:Wizard with two pages and a TabContainer inside each wizard step. I need to change "ajax__tab_body" default background-color:#ffffff to transparent color.

I have the following scenario:

- AJAX copied and added to project from "D:\AJAX Control Toolkit\AjaxControlToolkit\.."

- My stylesheet.css which contain the ".ajax__tab_xp-theme" modified theme as class: ".MyTabStyle" located in "~\css\stylesheet.css"

- A copy of AJAX Tab images in "~\images\tab.gif" "tab-hover.gif", "tab-active.gif" ... 

1. What happens between first and second load of wizard cause I can see it takes different syles css?

2. Most important: When I load the wizard the first time everything is OK, if I go to second page of Wizard It comes the rendering issue:

  - The right image of each tab "tab-right.gif" appears separated from the tab see here: Why ?

This is the class I modified:

TabContainer inside UpdatePanel not visible on IE


I have put a TabContainer inside an UpdatePanel. The TabContainer's TabPanels get populated with the content dynamically.  Whenever the browser is refreshed (F5), the TabContainer does not display I get a javascript error

Message: 'undefined' is null or not an object

This only happens in Internet Explorer.  If I put the cursor in the address bar and press the 'Enter' key, the TabContainer shows up again and the javascript error goes away.

A live sample can be see at http://www.ccrane.com/ on any of my product pages.

Any help figuring this out would be greatly appreciated.

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; .NET4.0C; .NET4.0E)
Timestamp: Wed, 13 Oct 2010 22:56:04 UTC

Finding control from master page inside tabcontainer in content page


I have a codebehind.vb for a master page from which I'm trying to find a hiddenfield in the content page. I was finding it like this without a hitch...

Dim hfContentSearch As HiddenField = CType(Page.Master.FindControl("main").FindControl("hfSearch"), HiddenField)

Then I decided to add an Ajax TabContainer to the content page. Now I'm having a hard time finding the hiddenfield. I've tried these variations, but still not working.

Dim hfContentSearch As HiddenField = CType(Page.Master.FindControl("main").FindControl("TabContainer1").FindControl("TabPanel1").FindControl("hfSearch"), HiddenField)

Dim hfContentSearch As HiddenField = CType(Page.Master.FindControl("main").FindControl("TabContainer1").FindControl("hfSearch"), HiddenField)

Dim hfContentSearch As HiddenField = CType(Page.Master.FindControl("main").FindControl("TabPanel1").FindControl("hfSearch"), HiddenField)

Can someone please help me with the syntax?

Thank you.


Google Interactive chart inside tabcontainer and updatepanels


I'm trying to implement Google Interactive chart inside an updatepanel.
The regular Google Charts do work (I think because there I'm just calling an URL).

But now I want the interactive chart inside an updatepanel within a tabcontainer etc. But now the request to Google is made, resulting in an infinitely loading white page to Google.

How can I get this to work?

See my FULL code below.


<script type="text/javascript" language="javascript">
    function pageLoad(sender, args) {
    function ActiveTabChanged(sender, e) {
        __doPostBack(sender.get_id(), sender.get_activeTabIndex());

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
       <cc1:TabContainer OnActiveTabChanged="TabChanged" ID="tabContainer" runat="server" ActiveTabIndex="0" OnClientActiveTabChanged="ActiveTabChanged" Width="100%&quo

Button event inside TabContainer ajax control not firing


I'm a little stumped, I can't get the event from a button to fire inside a TabContainer control. I have a TabContainer that is built dynamically based on a dataset. Then inside the TabPanels I had a dynamic user control (which is an HTML table with a text box and button on). See code:

Guid gu = System.Guid.NewGuid();                           

UsrCtrlQuestionBlock ucqb = (UsrCtrlQuestionBlock)LoadControl("~/Questionnaire/UsrCtrlQuestionBlock.ascx");                                                       ucqb.ID = "table_" + gu.ToString();                           

ucqb.Question = questions[i].QuestionText;                           

ucqb.Response = questions[i].Response;                           

ucqb.Audited = questions[i].Audited;                           

ucqb.Covered = questions[i].ReqCovered;              &nbs

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

How To Add calendar control inside a GridView

This article show hot to add calendar control inside a GridView with code in c#

Using ATLAS PopUp Control with Calendar inside the GridView Control

In this video tutorial Mohammad demonstrates how you can access the Calendar control which is displayed using the ATLAS PopUp control inside the GridView control.

RadioButton inside GridView, How to get it work as normal

Did you tried before to drag a RadioButton control inside a Gridivew templatefield, and then you attempt to select these RadioButtons , you will notice that the behavior of RadioButton control will be changed and it will work just like the behavior of checkbox control! the user will be able to select more than one radiobutton in the grid!

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.


I have 2 web pages. First page has a textbox and a button control.

when I enter test and click on the button , system goes to the second page. And in the second page I want to access the Textbox in the first page. When I try to do this I get the following error.

"Object reference not set to an instance of an object. Following is my code :

Dim txt As New TextBox

' Find the server name on the previous page
txt = CType(Page.PreviousPage.FindControl("TextBox2"), TextBox)
If Not IsNothing(txt) Then
Response.Write("[Name Not available]")
End If

I know I could do this with session, but I want to use the Page.PreviousPage.FindControl. Any help is greatly appreciated

LinkButton inside Repeater



I have Repeater, which consists of LinkButon and Literal. LinkButon and Literal are whole thing by implication. I want get value from Literal, when user click on corresponding LinkButton.


Textbox in ItemTemplate inside Gridview, unable to get the value


Hi. I have a itemtemplate inside a gridview.

<asp:TemplateField HeaderText="Enter OTP">
                            <asp:Label ID="Label2" runat="server"
                                style="font-family: Arial, Helvetica, sans-serif; font-size: x-small"
                                Text="PIN Num:"></asp:Label>
                            &nbsp;<asp:TextBox ID="txtPIN" runat="server" Height="21px" Width="100px"></asp:TextBox>

ASP.net Ajax TabContainer -- Printing All tabs



Can  anyone help me with this?. I want to print all the tabs in ajax tab container. The tab container has around 10 tabs. I dont want to goto each tab and print the page. Instead is there any way by which I can tweek the print.css file to print all the tabs at a single stretch?.  So that I will get all the contents of the tab in single print.  Is there any other way in which I can print all the tabs all together?.

Thanks in Advance...


Embed Youtube inside Ajax Html Editor- problem



When inserting a simple embed of youtube inside the ajax editor, on firefox and chrome problems occur. On the other hand on internet explorer 8 everything works fine. I found this solution http://www.nopcommerce.com/boards/t/4228/bug-in-ajax-html-editor.aspx . 

My question is where do I find the DesignPanel.pre.js ?


Roderick Vella

Gridview inside updatepanel


I am displaying large amount of data in gridview,the gridview placed within updatepanel,every 1sec i am refreshing updatepanel using ajax timer.my problem is while displaying large data the cpu performance is low,pls give idea to increase cpu performance..

how to get an array of all the asp.net textbox control inside create user wizard control?



How can I get all the textboxes inside a create user wizard control using getElementsByTagName().

Below is my JQuery code:

<script type="text/javascript">
        function addLoadEvent(func) {
            var oldonload = window.onload;
            if (typeof window.onload != 'function') {
                window.onload = func;
            } else {
                window.onload = function() {

        function prepareInputsForHints() {
            var inputs = document.getElementsByTagName("asp:TextBox");
            for (var i = 0; i < inputs.length; i++) {
                inputs[i].onfocus = function() {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
                inputs[i].onblur = function() {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "none";



<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend