submitting textbox data from panelbar to sql database

2 posts, 0 answers
  1. Ufuoma
    Ufuoma avatar
    5 posts
    Member since:
    Nov 2012

    Posted 21 Jan 2013 Link to this post

    Hello,

    Please, I am trying to submit data from controls like the textbox to the database from the panelbar containing them.

    The problem is I cannot access the textbox properties in my code behind. Like I am not doing something right.

    Thanks for the anticipated help.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Jan 2013 Link to this post

    Hi,

    I suppose you want to access the controls inside the RadPanelBar. Here is the sample code.

    ASPX:
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server">
        <Items>
            <telerik:RadPanelItem Text="RadPanelItem1">
                <ItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text="text"></asp:TextBox>
                </ItemTemplate>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>

    C#:
    //accessing the controls
    TextBox txt = (TextBox)RadPanelBar1.FindItemByText("RadPanelItem1").FindControl("TextBox1");

    Hope this helps.

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top