Adding textbox or label next to panel

Posted on 2009-02-23
Last Modified: 2012-06-27
I have a panel like this:

<asp:panel grouptext="Customer Info" runat="server" id="pnlCustomer">

This displays the panel like a Legend with text "Customer Info".

-- Now, I want  to add a textbox, or label or a linkbutton next to text "Customer Info".

Anyway to do this?
Question by:Camillia
    LVL 15

    Assisted Solution

    You want to do it during runtime?  Just do something like this.

    TextBox txtBox = new TextBox;
    txtBox.ID = "MyTextBox";
    LVL 12

    Accepted Solution

    Is it that you want the textbox or label, as part of the grouping text (i mean inline with it), then in the code file, you can have it as,
       pnlCustomer.GroupingText = pnlCustomer.GroupingText + "&nbsp;<input id=\"txtNew\"/>&nbsp;";
    LVL 1

    Assisted Solution

    groupText is a string property. So u cant do that directly
    U have to do something complex...
    LVL 7

    Author Comment

    yeah, I want to do that CB_Thirumalai is saying. But not in code behind.

    As urvinayan says..i want to do that directly. Let me play around with it. I want to add a LinkButton .
    LVL 7

    Author Comment

    i tried this and didnt work:

    <asp:Panel ID="pnlOrderNotes" runat="server" GroupingText="Order Notes" & <asp:LinkButton runat="server" Text="Add Note"/> >

    Maybe I need to do this dynamically??

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video discusses moving either the default database or any database to a new volume.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now