Monday, March 26, 2012

tab control not visible

Hi,

I have a project in to which i added the ajax control toolkit.Then i added the tab container to a page.

The are no errors while compiling ,But the tab control is not visible in the page after running.The code is as follows

<table width="100%" cellSpacing="1" cellPadding="0" align="left">

<tr>
<td style="width: 100%">
<ajaxToolkit:TabContainer runat="server" ID ="tabs" OnClientActiveTabChanged="ActiveTabChanged" ActiveTabIndex="0">
<ajaxToolkit:TabPanel ID ="panel1" runat="server" HeaderText=" Personal ">
<ContentTemplate>
<table width="100%" cellSpacing="1" cellPadding="0" >
<tr>
<td style="width: 110%">
<table width="100%" cellSpacing="1" cellPadding="0" align="left">
<tr>
<td class="itemcolor" >

Employee Id:</td>
<td class="itemcolor"><asp:TextBox ID="txtEmpCode" runat="server" width="198px"></asp:TextBox>
</td>
<td class="itemcolor" width="50"></td>
<td class="itemcolor">
Access Rights:</td>
<td class="itemcolor"><asp:DropDownList ID="ddlAcessRights" runat="server" Width="198px"></asp:DropDownList></td>
</tr>
<tr>
<td class="itemcolor" width="198"></td>
<td class="itemcolor" width="198"></td>
<td class="itemcolor" ></td>
<td class="itemcolor" width="198"></td>
<td class="itemcolor" width="198"></td>
</tr>
</table>
</td>
</tr>
</table>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID ="panel2" runat="server" HeaderText=" Official ">
<ContentTemplate>
<table>
<tr>
<td>
<asp:TextBox runat="server" ID="test"></asp:TextBox>
</td>
</tr>
</table>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>

</td>
</tr>
</table>

Please help me

Thanks and regards

Prathibha

Hi,

I made a new page and copied your tabContainer-code into it and it displays just fine!

Do you get any errors?

Does other Ajax functionality work?

Do other ajaxControlToolkit-controls work?

Can you post the code of the whole page?

Please answer my questions!

Kind regards,
Wim


Couldn't see an error, so it must come from something else on the page.. Wild guess: rounded corners extender?

Edit:

- I copy pasted this exact code in a test.aspx..

- added the scriptmanager.

- got a javascript error saying: "ActiveTabChanged is undefined".Which is correct.. (And nothing showing.)

--> So I removedOnClientActiveTabChanged="ActiveTabChanged"

And then the page displayed correctly..


hi,Thanks to all.I got it correct.But i am not able to access the controls placed in the content template using javascript.

I have a textbox "txtEmpCode" placed in the content template of tab control.then i tried to access it as follows

document.getElementById("txtEmpCode")

But im getting null value

please help..

thanks n regards

prathibha


Hi Prathibh,

To access the control , please do it like this. $get("<%=txtEmpCode.ClientID%>"). $get equals to document.getElementById.

Best regards,

Jonathan


You needs to change your web config file for ajax supporting...for these you take File->New website->Ajax enabled website...and copy the special tags for ajax into your webconfig....

No comments:

Post a Comment