Link to home
Create AccountLog in
Avatar of htabbach
htabbachFlag for United States of America

asked on

AJAX Tab control is not working, asking for source for TabContainor.cs

Hello,

I have not worked with AJAX before so this question may sound simple to some of you. I hav ben trying to implement a tb control in my web app and some directed me to AJAX, I downloaded the framwork and the toolkit and implemented it on my page. It complies with no errors, the problem is when i open the page from the development environment it asks me for the path to the source of TbContainer.cs, I cnnot find that on my machine. Any ideas why this is happening?

thanks
Avatar of Bane83
Bane83
Flag of Canada image

Have you moved the AjaxControlToolkit.dll into your Bin folder?  I've also noticed that I get that popup sometimes when debugging the application/stepping through the code.  Clicking cancel and resuming the debug session usually works for me.
Avatar of htabbach

ASKER

Well, first, I do have the dll in the bin folder. second, when I insert a scriptmanager tag it says that it is unknown. I cannot see a Tabpanel object on the tool kit explorer.
Ah, there's your issue.  You have to modify your web.config file so that it knows how to use the ajax components.

In VS2005, create a new website and you should see a template for creating an Ajax Enabled Website or something along those lines.  Once you create a new website like that, you'll get a web.config which has been configured to use the ajax components.  Copy that one over to your current project and add in any modifications you had made to your original web.config.
Thanks! the error is gone. however, I still cannot see the tabs :(
Hmm... Can I see some code?  Specifically, the way you're defining the tabs and anything that might be relevant from the code file?
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="NewCall1.aspx.vb" Inherits="NewCall1" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>New Call</title>
</head>
<body>
    <form id="form1" runat="server">
    <cc1:ToolkitScriptManager ID="testScript" runat="server"></cc1:ToolkitScriptManager>
    <div>
   
        <cc1:TabContainer ID="TabContainer1" runat="server">
            <cc1:TabPanel ID="tab1" HeaderText="test1" TabIndex="0">
                <ContentTemplate>Hello</ContentTemplate>
            </cc1:TabPanel>
       
       
            <cc1:TabPanel ID="TabPanel1" HeaderText="test1"TabIndex="1">
                <ContentTemplate>Hello</ContentTemplate>
            </cc1:TabPanel>
        </cc1:TabContainer>
       
    </div>
    </form>
</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of Bane83
Bane83
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
When I aded the runat="srver' to the tabpanel I got a .net error saying the server tg is  not formed well, I tke them out the error goes away but the tabs don't show.
That's bizarre.  The only difference I can think of is that I left out the TabIndex attributes.  Otherwise, it should work.  Did you also replace the ToolkitScriptManager with an asp:ScriptManager?
NO, I don't have that tag available for some reason!
I took out the tabindex and guess what? it worked, very strange.
It's odd that you don't have the asp:ScriptManager.  That should have become available once you installed the AJAX framework.  Regardless, it seems to be working, so that's good.
Thnk you so much... one last thing, The menu headers are showing strange, please see ttached file, I'm gonna copy some of the code here:
<body>
            <form id="Form1" runat="server">
            <cc1:ToolkitScriptManager ID="testScript" runat="server"></cc1:ToolkitScriptManager>
            <div>
            <table id="table1" runat="server">
            <tr>
            <td>
            
            <cc1:TabContainer ID="TabContainer1" Width="500" Visible="true" runat="server">
            <cc1:TabPanel ID="tab1" runat="server" Height="50"  HeaderText="Start Call">
                <ContentTemplate>
                    <table width="800" height="500" cellpadding="0" cellspacing="0">
                              <tr>
                                  <td valign="top" bgcolor="silver" bordercolor="#003300" >
                                      <p style= "COLOR: red; font-size: 14px;">&nbsp;0)
                                    <asp:Label ID="lblScript0" runat="server" Width="742px"></asp:Label></p>
                                      <p style="COLOR: red; font-size: 14px;">1)
                                    <asp:Label ID="lblScript1" runat="server" Width="759px"></asp:Label></p>
                                <p style="font-size: 14px; color: red">
                                    2)&nbsp; <asp:Label ID="lblScript2" runat="server" Width="726px"></asp:Label></p>
                                <p style="font-size: 14px; color: red">
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:RadioButton id="rbProspect" AutoPostBack="true" runat="server" Text="Prospect" ForeColor="Black" GroupName="Prospect" style="font-size: 14px"></asp:RadioButton>
                                            <asp:RadioButton id="rbNonProspect" AutoPostBack="true" runat="server" Text="Non Prospect" ForeColor="Black" GroupName="Prospect"></asp:RadioButton></p>
                                      <p style="COLOR: red; font-size: 14px;">3)
                                    <asp:Label ID="lblScript3" runat="server" Width="742px"></asp:Label></p>
                                <p style="font-size: 14px; color: black">
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
                                    Name: &nbsp;<asp:TextBox id="txtFName" runat="server"></asp:TextBox>
                                            <asp:TextBox id="txtLName" runat="server"></asp:TextBox></p>
                                      <p style="COLOR: red; font-size: 14px;">4) &nbsp;<asp:Label ID="lblScript4" runat="server" Width="766px"></asp:Label>
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</P>
                                <p style="font-size: 14px; color: black">
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;Phone:&nbsp;&nbsp;
                                            <asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
                                            <asp:RadioButton id="rbHome" AutoPostBack="true" runat="server" Text="Home" GroupName="Phone"></asp:RadioButton>
                                            <asp:RadioButton id="rbCell" runat="server" Text="Cell" GroupName="Phone"></asp:RadioButton>
                                            <asp:RadioButton id="rbWork" runat="server" Text="Work" GroupName="Phone"></asp:RadioButton>
                                            <asp:RadioButton id="rbRefused" runat="server" Text="Refused/NA" GroupName="Phone"></asp:RadioButton></p>
                                <p>
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                    &nbsp;
                                </p>
                                    </td>
                                </tr>
                            </table>
                </ContentTemplate>
            </cc1:TabPanel>
       
       
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="test1">
                <ContentTemplate>
                    <table width="800" height="500" cellpadding="0" cellspacing="0">
                              <tr>
                                  <td valign="top" bgcolor="silver" bordercolor="#003300" style="font-size: 14px;">
                               
                                <p style= "COLOR: red; font-size: 14px;">5)
                                    <asp:Label ID="lblScript5" runat="server" Height="18px" Width="764px"></asp:Label><br /></p>
                                <p style= "COLOR: black; font-size: 14px;">
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Issue Type:&nbsp;
                                    <asp:DropDownList
                                    ID="ddIssueType" runat="server" Width="301px">
                                </asp:DropDownList><br />
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Additional Comments &nbsp;
                                &nbsp;
                                <asp:TextBox ID="txtAddComments" runat="server" Height="112px" TextMode="MultiLine"
                                    Width="296px"></asp:TextBox><br /></p>
                                    <p style="font-size: 14px; color: red">
                                        6) &nbsp;<asp:Label ID="lblScript6" runat="server" Width="749px"></asp:Label></p>
                                    <p style="font-size: 14px; color: black">
                                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Phone:&nbsp;
                                    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></p>
                                    <p style="color: red">
                                        7) &nbsp;<asp:Label ID="lblscript7" runat="server" Width="756px"></asp:Label></p>
                                    <p style="color: black">
                                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Name &nbsp;
                                        <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                                        &nbsp;
                                        <asp:TextBox ID="TextBox4" runat="server" Width="142px"></asp:TextBox></p>
                                    <p style="color: red">
                                        8)
                                        <asp:Label ID="lblScript8" runat="server" Width="750px"></asp:Label></p>
                                    <p>
                                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;
                                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Space # &nbsp;<asp:TextBox ID="txtSpaceNumber" runat="server"></asp:TextBox></p>
                                  
                                  </td>
                              </tr>
                    <tr>
                        <td bgcolor="silver" bordercolor="#003300" style="font-size: 14px;
                            color: red">
                        </td>
                    </tr>
                      </table>
                </ContentTemplate>
            </cc1:TabPanel>
           
            <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="test1">
                <ContentTemplate>
                    <table width="800" height="500" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td valign="top" bgcolor="silver" bordercolor="#003300" bordercolordark="black" style="font-size: 14px; color: blue;">
                                &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<asp:Label ID="Label1" runat="server"
                                    Font-Bold="True" Text="Propert Features" Width="131px"></asp:Label><br />
                                <br />
                                <br />
                                &nbsp;&nbsp;
                                Office Hours: &nbsp; &nbsp;&nbsp;
                                <asp:Label ID="lblOfficeHours" runat="server" Height="14px" Style="color: red" Width="658px"></asp:Label><br />
                                <br />
                                <br />
                                &nbsp;&nbsp; Gate Hours: &nbsp; &nbsp; &nbsp; &nbsp;<asp:Label ID="lblGateHours"
                                    runat="server" Style="color: red" Width="676px"></asp:Label><br />
                                <br />
                                <br />
                                &nbsp;&nbsp; Closed Holidays:
                                <asp:Label ID="lblClosedDays" runat="server" Style="color: red" Width="669px"></asp:Label></td>
                                </tr>
                            </table>
                </ContentTemplate>
            </cc1:TabPanel>
           
            <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="test1">
                <ContentTemplate>
                    <table width="800" height="500" cellpadding="0" cellspacing="0">
                           
                                <tr>
                                    <td valign="top" bgcolor="silver" bordercolor="#003300" style="font-size: 14px; color: black;">
                                <br />
                                <br />
                                &nbsp;&nbsp; Adress:
                                <asp:Label ID="lblAddress" runat="server" Width="149px" style="color: blue"></asp:Label>
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Cross Streets:
                                <asp:Label ID="lblCrossStreets" runat="server" Width="387px" style="color: blue"></asp:Label><br />
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
                                <asp:Label ID="lblAddress2" runat="server" Width="205px" style="color: blue"></asp:Label><br />
                                <br />
                                &nbsp;&nbsp; Landmarks:
                                <asp:Label ID="lblLandmarks" runat="server" Width="620px" style="color: blue"></asp:Label><br />
                                <br />
                                <br />
                                <br />
                                <br />
                                &nbsp;&nbsp; Neighboring Areas:
                                <asp:Label ID="lblNAreas" runat="server" Width="643px" style="color: blue"></asp:Label><br />
                                <br />
                                &nbsp;&nbsp; Driving Directions:<br />
                                <br />
                                &nbsp;&nbsp;
                                <asp:DropDownList ID="ddDrivingInstructions" runat="server" AutoPostBack="True" Width="181px">
                                </asp:DropDownList><br />
                                &nbsp;&nbsp;
                                <br />
                                &nbsp;&nbsp; Directions:<br />
                                <br />
                                &nbsp;&nbsp;
                                <asp:Label ID="lblDirections" runat="server" Width="765px" style="color: blue"></asp:Label></td>
                                </tr>
                            </table>
                </ContentTemplate>
            </cc1:TabPanel>
           
            <cc1:TabPanel ID="TabPanel4" runat="server" HeaderText="test1">
                <ContentTemplate>
                    <table width="800" height="500" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td valign="top" bgcolor="silver" bordercolor="#003300" style="font-size: 14px; color: red;">
                                <br />
                                <br />
                                <asp:DataGrid id="dgUnits" runat="server" AllowSorting="true">
                                   <Columns>  
                                     <asp:TemplateColumn Visible ="false"  HeaderText="Size">  
                                       <ItemTemplate>  
                                         <%# Container.DataItem("Size") %>  
                                       </ItemTemplate>  
                                     </asp:TemplateColumn>  
                                     <asp:TemplateColumn Visible ="false" HeaderText="Price">          
                                       <ItemTemplate>            
                                         <%# Container.DataItem("Price") %>          
                                       </ItemTemplate>        
                                     </asp:TemplateColumn>      
                                   
                                    <asp:TemplateColumn HeaderText="Select">          
                                       <ItemTemplate>            
                                          <asp:CheckBox ID="chkSelect" runat ="server" />      
                                       </ItemTemplate>        
                                     </asp:TemplateColumn>      
                                   </Columns>  
                                </asp:DataGrid>


                                </td>
                                </tr>
                            </table>
                </ContentTemplate>
            </cc1:TabPanel>
           
            <cc1:TabPanel ID="TabPanel5" runat="server" HeaderText="test1">
                <ContentTemplate>
                     <table width="800" height="500" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td valign="top" bgcolor="silver" bordercolor="#003300" style="font-size: 14px; color: red;">
                                <br />
                                <br />
                                9)&nbsp;
                                <asp:Label ID="lblScript9" runat="server" Style="color: red" Width="755px"></asp:Label><br />
                                <br />
                                10)
                                <asp:Label ID="lblScript10" runat="server" Width="752px"></asp:Label>&nbsp;<br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                                <br />
                               
                                <br />
                                <br />
                                <br />
                                <br />
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                &nbsp; &nbsp;
                               
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                &nbsp; &nbsp; &nbsp;&nbsp;
                                </td>
                                </tr>
                                <!--<asp:PlaceHolder ID="plcEndCall" runat="server" Visible="true">-->
                                <tr>
                                    <td style="background-color: silver"><asp:Label ID="lblNotSentsection" Text="Send notification to facility" runat ="server"></asp:Label></td>
                                </tr>
                                <tr>
                                    <td style="background-color: silver">
                                       <asp:Label ID="lblSent" Text="Yes" runat ="server"></asp:Label>
                                       <asp:RadioButton ID="rbSend" runat ="server" GroupName="sendNotification" />
                                       <asp:Label ID="lblNotsent" Text="No" runat ="server"></asp:Label>
                                       <asp:RadioButton ID="rbDontSend" onclick="NotSent();" runat ="server" GroupName="sendNotification" AutoPostBack="True" />
                                    </td>
                                </tr>
                                <!--</asp:PlaceHolder>-->
                                <asp:PlaceHolder ID="plcReasonNotSent" runat="server" Visible ="false">
                                <tr>
                                    <td style="background-color: silver">
                                &nbsp;<asp:ListBox ID="lbReasonNotSent" runat="server" Height="112px" Width="311px"></asp:ListBox></td>
                                </tr>
                                </asp:PlaceHolder>
                                <tr>
                                    <td style="background-color: gray">
                                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<input type="submit" id="btnEndCall" onclick="Save();" runat="server" value="End and Process Call" />
                                    </td>
                                </tr>
                            </table>
                </ContentTemplate>
            </cc1:TabPanel>
        </cc1:TabContainer>
        </td>
        <td>
            <br /><asp:Label ID="lblBulletin" runat="server" Height="500px" Style="vertical-align: top;
                    background-color: yellow; text-align: left" Width="200px"></asp:Label>&nbsp;</td>
       
        </tr>
            </table>
                           
                   
                  
               
                      
                  
                  
                  
                  
                  <input id="hdnField" runat="server" type="hidden" />
            </div>
                  </form>
      </body>
</html>
<script type="text/jscript">
    function NotSent()
   
    {
        document.Form1.submit;
        document.Form1.hdnField.value = "NotSent";
    }
    function Save()
    {
        document.Form1.hdnField.value = "save";
    }
</script>
Screen-Shot.doc
I'm not really sure, but try removing the Height="50" from your first TabPanel.
Ok, I will try that, I tried to make one of the tabs not visible in the vb code by making tabpanel1.visible = false but it made all tabs invisible, does it support this feature?
I'm not sure.  I used the TabContainer once a long time ago, but it didn't have a feature I needed and I switched to a competitors control.
What do you think is the best tab control?
I use the tab control from www.telerik.com, but it's not a free control.
Thanks, you have been a great help.
htabbach--I'd like to know if you resolved your issue with the tabs themselves, where the bottom half of the lettering isn't invisible.  I am currently trying to resolve this :(