Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Monday, March 26, 2012

Tab Control Error

Friends,

I am using Tab Control(developed using ATLAS,downloaded from net) in my project, it working fine.But when the Session has expired, if I click any Links on the page, will redirect to Login Page. But while clicking the Tabs in the Tab Control, its throwing an Unknown Error through Alert box.

Any Help, Thanks in Advance.

Regards,

Vasanth

Is the Tab control visible depending on the session and user? Did you add this tab control in a usercontrol so you can post it here? I would like to test it. I use that control quite a lot without any problem.

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....

Saturday, March 24, 2012

TabContainer and TabPanel - Error Rendering Control, An unhandled exception has occurred.

I get this error in the designer when I place either TabContainer or TabPanel on any page in my project. I also get it if I look at the Tabs.aspx page in the toolkit sample website that comes with the source code. This has been happening for a while now and is rather anoying.

Anyone else get this error in the designer?

I only get it on the TabPanel
No resolution found yet


Are you saying that if you open Tabs.aspx from the SampleWebsite in the designer you get this error? Or when you run the page?

In either case, I don't see the problem. More info might help narrow it down.


Yes you do get this error if you have no ScriptManager control on your page. I assume you did the obvious and add one. Otherwise you've got an installation problem, because it works for me.

As of the Latest Release 23/01/2007 the errors are gone.Smile


I'm looking at putting together a bit of a better designer for tabs hopefully for the next release.

Thank you for your time. I look forward to the next release.


Currently, I'm experiencing the same error with the latest release.

Have you tried the following:

Make sure there is a ScriptManager as the top most component of the page or if you have a ScriptManager on a MasterPage then make sure it is before your Content areas.

Have you tried the following:

Make sure there is a ScriptManager as the top most component of the page or if you have a ScriptManager on a MasterPage then make sure it is before your Content areas.

Have you tried the following:

Make sure there is a ScriptManager as the top most component of the page or if you have a ScriptManager on a MasterPage then make sure it is before your Content areas.

Have you tried the following:

Make sure there is a ScriptManager as the top most component of the page or if you have a ScriptManager on a MasterPage then make sure it is before your Content areas.
I am also haveing the same issue. I started a new AJAX Website from the template provided and when I drag a tab panel onto the page I get the above error. I don't have an old version since I just downloaded it today.

Did anyone figure out the solution to this? I too downloaded a new version, only this tool is still giving me a problem by not working at all.

Wednesday, March 21, 2012

TabContainer in Master Page, TabPanel in Content Page...does it work?

I just started a new project, and before I go wasting my time and energy on this concept, let me find out for certain. If in my Master Page, I declare a TabContainer, and between those opening and closing tags I put the declaration of the ContentPlaceholder, then in each Content page, the entireity of the content is inside a TabPanel...will that work? Can I do it that way at all, even if there have to be some workarounds? And if there are, what are those workarounds?

Appreciate any help anybody can offer!

Hi Ando,

Yes , you can do it like this .

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">
<ajaxToolkit:TabPanel ID="TabPanel1" runat="server">
<HeaderTemplate>
Tab1</HeaderTemplate>
<ContentTemplate>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel2" runat="server">
<HeaderTemplate>
Tab2</HeaderTemplate>
<ContentTemplate>
<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
</form>

ContentTemplate works like a container(Div);

I hope this help.

Best regards,

Jonathan


Does this example only work on a certain AJAX.NET release (I'm current using release 10920)? It'll certainly be handy if this method worked :)

I've tried the above but I'm getting the following Exception:

System.Web.HttpException was unhandled by user code
Message="TabContainer cannot have children of type 'System.Web.UI.WebControls.ContentPlaceHolder'."
Source="AjaxControlToolkit"
ErrorCode=-2147467259
StackTrace:
at AjaxControlToolkit.TabContainer.AddParsedSubObject(Object obj) in d:\E\AjaxTk-AjaxControlToolkit\Release\AjaxControlToolkit\Tabs\TabContainer.cs:line 311
at System.Web.UI.Control.System.Web.UI.IParserAccessor.AddParsedSubObject(Object obj)
at ASP.presentation_masterpage_master.__BuildControlTabContainer1() in d:\Data\Visual Studio 2005\WebSites\PTOK\Presentation\MasterPage.master:line 16
at ASP.presentation_masterpage_master.__BuildControlform1() in d:\Data\Visual Studio 2005\WebSites\PTOK\Presentation\MasterPage.master:line 11
at ASP.presentation_masterpage_master.__BuildControlTree(presentation_masterpage_master __ctrl) in d:\Data\Visual Studio 2005\WebSites\PTOK\Presentation\MasterPage.master:line 1
at ASP.presentation_masterpage_master.FrameworkInitialize() in d:\Data\Visual Studio 2005\WebSites\PTOK\Presentation\MasterPage.master.cs:line 912306
at System.Web.UI.UserControl.InitializeAsUserControlInternal()
at System.Web.UI.UserControl.InitializeAsUserControl(Page page)
at System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)
at System.Web.UI.Page.get_Master()
at System.Web.UI.Page.ApplyMasterPage()
at System.Web.UI.Page.PerformPreInit()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Hi SpaceToaster,

I have tested on V10920 and it works pretty well. Please make sure that you have put the sample code inside the Master.page and make the content page as simple as possible. For example,

<%@. Page Language="C#" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>

<script runat="server">

</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<%=DateTime.Now.ToString()%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
2131
</asp:Content>

I hope this help.

Best regards,

Jonathan


Hi Jonathan,

I don't see how the code you posted above is the same as the original example you have shown.

The exception was thrown after I've placed a ContentPlaceHolder inside a TabContainer.

Thanks,


Hi Spacetoaster,

My first reply provide Master Page code and the second reply provide the Content Page code. So combine them will get a test sample.

Would you please test it on your machine? I have tested it on IE7 and Firefox2. Please make sure the TabContainer which contains aContentPlaceHolder is located inside the Master Page. If this doesn't work, please feel free to let me know with a simple repro which certainly can reproduce your issue.

Hope this help.

Best regards,

Jonathan


Hello Jonathan ;

I m using the same style as you replied in post 2 of this thread. I can add my one .aspx page in first Contentplaceholder1 but cant add second .aspx page in the second Contentplaceholder2 which is in second tab?

FYI: I have two pageload events in these two different pages? Do i have remove one ??


Hi Saqib_dotnet,

saqib_dotnet:

FYI: I have two pageload events in these two different pages? Do i have remove one ??

Yes, or one pageLoad function will be ignored.

Best regards,

Jonathan


So i have two different aspx file.

Tab1.aspx and Tab2.aspx files.

I will keep Page_Load Tab1.aspx and remove from the other, then how the other page will be processed with the first page? I mean what will invoke the Tab2.aspx functions?

REgards


Hi Saqib_dotnet,

UserControls located in the same page works as these functions & controls are put in the same page. So you can call the function directly.

saqib_dotnet:

I will keep Page_Load Tab1.aspx and remove from the other, then how the other page will be processed with the first page? I mean what will invoke the Tab2.aspx functions?

Please make sure that the right function name is pageLoad but not PageLoad or Page_Load. I suggest that you can change the pageLoad function to a common js fucntion (modify name) and remain them in the original place. Then , add pageLoad function to the end of the page, now we can call the other functions on pageLoad.

Best regards,

Jonathan



Hi Saqib_dotnet,

If you mean server side method, all Page_Loads will be executed. If it is a client side function(javascript function), you should usepageLoad function.

Best regards,

Jonathan


I thought we are talking about the Page_Load event handler function ?

Is there any other function pageLoad?


Hi Saqib_dotnet,

That's based on your implementation. I think you should add breakkpoints and find out the exact root cause.

Best regards,

Jonathan


First of all i never went so far where I worked with JS functions. All i m using is ScriptManager and it looks like, it is handling everything.

Now my question is: I created master page with two tabs like described above. Then added two different aspx pages to the ContentPlaceHolders respectively. Both pages are in two different files and both have server side Page_Load functions.

Now when i run theApplication, only my defult page get populated in first Tab but not the other page which should be populated in second Tab.

Where the problem is?

Also, I m trying to load the second tab when user clicks it? What should I do for this as well.

Regards