Showing posts with label tabpanel. Show all posts
Showing posts with label tabpanel. Show all posts

Monday, March 26, 2012

Access the control in Tabpanel on TabpanelContainer?

My second tab have some controls, ex. Textbox1, how can i access the value of Textbox1 in Tabpanel2 ?

Thanks,

I believe that Textbox1.Text should work for you... but I cannot try because I'm on diferent machine.


Hi,

Here is an example of referencing it with the help of FindControl method.

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server">
protected void Page_Init(object sender, EventArgs e)
{
TextBox tb = Panel2.FindControl("TextBox1") as TextBox;
tb.Text = DateTime.Now.ToString();

}

</script
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div><asp:Button runat="server" Text="Button" ID="Button1"></asp:Button>
<ajaxToolkit:TabContainer runat="server" Height="150px" ID="tbcPlanOverview" >
<ajaxToolkit:TabPanel runat="Server" ID="Panel1" HeaderText="Tab One">
<ContentTemplate>
PAGE ONE - Sample HTML Content for Tab
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel runat="Server" ID="Panel2" HeaderText="Tab Two" >
<ContentTemplate>
PAGE TWO - Sample HTML Content for Tab
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</ContentTemplate>
</ajaxToolkit:TabPanel
<ajaxToolkit:TabPanel runat="Server" ID="Panel3" HeaderText="Tab Three">
<ContentTemplate>
PAGE THREE - Sample HTML Content for Tab
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer> <br />
<asp:Image ID="Image1" runat="server" />
<asp:TextBox ID="txtTabSelect" runat="server" />
</div>
</form>
</body>
</html>

Saturday, March 24, 2012

A simple problem with the Tab Control.

I did my homework and researched the control failing to fire child events...

http://forums.asp.net/p/1176424/1982365.aspx#1982365

I have a TabPanel with 3 DDL's on it..(1) CardType, (2) expiration Month and (3)Year

none of the SelectedIndexChanged events fire, regardless of the property settings.

I checked the SampleWebsite and was alarmed that the sample shows most of the

common control typesEXCEPT a dropdown list..?? Comments? Solution? Tongue Tied

Thanks in advance..Cool

As of version10920 the only practical way to do it is to put them on the

page separatley and make themvisible / notvisible as you need them

in theActiveTabChanged event. The events of those DDL's will then fire.Big Smile

I thank myself for my input..Cool