Showing posts with label placed. Show all posts
Showing posts with label placed. Show all posts

Wednesday, March 28, 2012

Tab container

hi all,

i have placed the tab container in side a datagrid. tab container will appear in the item command of datagrid. if i set the active tab index as zero. i got some error.

57 line 17 char

argument out of range exception

1495 line 38 char

this.get_element().style is null or not an object.

if i remove that active tab index property tab container works fine.

how to close the tab container?

please help me

Balaji

Hi Balaji,

Can you show me your relevant code so that I can reproduce your issue?
A stripped simpler version of your code would be better.

Looking forward to your reply.

hi,

here is my code snippet

protectedvoid dlHostels_ItemCommand(object source,DataGridCommandEventArgs e)

{

tabcontainer tbc=new tabcontainer();

tbc = (TabContainer)dlHostels.Items[e.Item.ItemIndex].FindControl("TabContainer1");

Label lblInfo =newLabel();

TabPanel tp = new tabpanel();

tp.controls.add(lblinfo);

tbc.controls.add(tp);

//i have added three panels to this tabcontainer.

tbc.activetab=0; // problem with this tabindex. if i didnt mention anything then it works fine.

}

Monday, March 26, 2012

Tab Index

hai,

i had placed tab control inside multiview panel which has the view index 1.in the page load event i show only view index 0.my problem is when i click the the button to change view index to 1,tab panel does not appear properly[i.e css not applied] and active index changed event also does not fire.how can i use tab panel inside multiview with visibility set to false.

thanks in advance

Hi,

Is your tab is displaying?,,,,,or not displaying....tab is usually coming with a default css (tab__xp)...if its ok..then check your web config..is it configured for ajax supporting...i think u created your website using File->Newwebsite->Asp.net website instead of this use File->New->website->Ajax enabled website...than ajax supporting tags will automatically comes in web config...please confirm this..if its ok then check your bin folder from ajaxtoolkit dll,if its not there copy that dll to bin folder..

Prajeesh

ASP.net developer

www.prajeesh.7p.com


Hi,

My Tab Panel is displaying,When I set the visibility of the tabcontainer to true at page load.If i set false at page load it does not viewed properly.please clear me i am new to ajax.i am using ajax enabled site only.

And i have another one problem now.

I have to create tab panels dynamically at runtime from database.But when i create like this i have one dropdownlist on that page.when i fire selected index change event for that dropdown it shows error like "Specified argument was out of the range of valid values.".

what will be the problem

thanks in advance


Can u show me your code to display and dynamically adding tabs?..it will be helpful to analyse the problem..

Regards,

Prajeesh


protectedvoid Page_Init(object sender,EventArgs e)

{

LoadModuleDetails();

}

protectedvoid Page_Load(object sender,EventArgs e)

{

if (!Page.IsPostBack)

{

LoadModuleDetails();

}

}

publicvoid LoadModuleDetails()

{

objdsMenu.Reset();

objdsMenu.Clear();

objdsMenu = objEmployee.MenuMaster(13);

if ((objdsMenu !=null) && (objdsMenu.Tables.Count > 0) && (objdsMenu.Tables[0].Rows.Count > 0))

{

for (int itabcnt = 0; itabcnt <= objdsMenu.Tables[0].Rows.Count - 1; itabcnt++)

{

AjaxControlToolkit.TabPanel TabPan =new AjaxControlToolkit.TabPanel();

TabPan.HeaderText = objdsMenu.Tables[0].Rows[itabcnt]["ModuleName"].ToString();

GridView grdPMS =newGridView();

//grdPMS.AutoGenerateColumns = false;

//BoundColumn bndmenuid = new BoundColumn();

//bndmenuid.HeaderText = "Menu ID";

//bndmenuid.DataField = "MenuID";

//grdPMS.Columns.Add(bndmenuid);

TabPan.Controls.Add(grdPMS);

TabContainer1.Controls.Add(TabPan);

}

//objds.Clear();

//objds.Reset();

//objEmployee.ParentID = 9;

//GridView grdPMS =(GridLines)Page.FindControl("grdPMS");

//BindMenuGrid(grdPMS);

}

}


Please give me source of aspx code also.....

Wednesday, March 21, 2012

TabContainer inside Master page

Hi everyone

In my Webapplicaton i have Master Page .

One of my webpage i have placed the Tabcontainer inside the

Design Code:

<%@dotnet.itags.org.PageLanguage="C#"MasterPageFile="~/MstrPages/Default.master"AutoEventWireup="true"CodeFile="VQuote.aspx.cs"Inherits="VQuote"Title="Untitled Page" %>

<%@dotnet.itags.org.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"
runat="server">
</asp:ScriptManager>

<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<cc1:TabContainer ID="SampleTabContainer" runat="server" ActiveTabIndex="0" TabIndex="0">
<cc1:TabPanel ID="Panel1" runat="server" HeaderText="Panel1">
<ContentTemplate>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="Panel2" runat="server" HeaderText="Panel2">
<ContentTemplate>
<table>
<tr>
<td>
<asp:Label ID="Label1" runat="server">Group Name</asp:Label>
</td>
<tr>
<asp:Label ID="lblGrouName" runat="server"></asp:Label>
</tr>
</table>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
</contenttemplate>
</asp:UpdatePanel>
</div>
</asp:Content>

when i load the page i am getting the below error:

System.Web.HttpException : {"The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)."}

Message : "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)."

stacktrace : " at System.Web.UI.ControlCollection.Add(Control child)\r\n at AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control)\r\n at AjaxControlToolkit.ScriptControlBase.OnPreRender(EventArgs e)\r\n at System.Web.UI.Control.PreRenderRecursiveInternal()\r\n at System.Web.UI.Control.PreRenderRecursiveInternal()\r\n at System.Web.UI.Control.PreRenderRecursiveInternal()\r\n at System.Web.UI.Control.PreRenderRecursiveInternal()\r\n at System.Web.UI.Control.PreRenderRecursiveInternal()\r\n at System.Web.UI.Control.PreRenderRecursiveInternal()\r\n at System.Web.UI.Control.PreRenderRecursiveInternal()\r\n at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"

when i debug i am getting error at this object:

ScriptObjectBuilder.cs

public static void RegisterCssReferences(Control control)
{
foreach (string styleSheet in ScriptObjectBuilder.GetCssReferences(control))
{
// Add the link to the page header instead of inside the body which is not xhtml compliant
HtmlLink link = new HtmlLink();
link.Href = styleSheet;
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
control.Page.Header.Controls.Add(link); --Here I am getting the error


}
}

Please any can help to solve this issue

regards

kumaran

Hi Kumaran,

The sample you provided itself is correct.

As the error message indicates, please don't use code block in your page, use assignment in code behind instead.