Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

How to access the value of asp:Textbox control that's witin in Accordion Pane from codebehind in c#

$
0
0

<ajaxToolkit:Accordion ID="Accordion2" runat="server" BackColor="#E5E5E5" Width="60%">
<Panes>

<ajaxToolkit:AccordionPane ID="AccordionPane1" runat="server">

<Header><Strong>Update Extras</Strong></Header>
<Content>

<asp:Label ID="lblTitle" runat="server" Text="Title:" Visible="true"></asp:Label>
<asp:TextBox ID="txtTitle" runat="server" Visible="true"></asp:TextBox>
<asp:Label ID="lblQty" runat="server" Text="Quantity:" Visible="true"></asp:Label>
<asp:TextBox ID="txtQty" runat="server" Visible="true" Width="70"></asp:TextBox>
<asp:Label ID="lblPrice" runat="server" Text="Price:" Visible="true"></asp:Label>
<asp:TextBox ID="txtPrice" runat="server" Visible="true" Width="70"></asp:TextBox>

</Content>
</ajaxToolkit:AccordionPane>

I want to grab the value of txtTitle from code behind. How do i go about it? Things I have tried:

TextBox txt = (TextBox)Accordion2.FindControl("AccordionPane1").FindControl("txtTitle");
string test1 = txt.Text;

TextBox tb2 = (TextBox)AccordionPane1.FindControl("txtTitle");
TextBox tb3 = (TextBox)Accordion2.FindControl("txtTitle");
string test2 = tb1.Text;
string test3 = tb2.Text;

string test4 = txtTitle.Text;


Viewing all articles
Browse latest Browse all 5678

Trending Articles