C# Web-App: Panel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raghulvarma
    New Member
    • Oct 2007
    • 90

    C# Web-App: Panel

    I have used the panel in my web page. It works fine also but the problem is that when the controls are displayed in the panel The text "panel" is also being displayed.That should not be displayed how to do that.I get the number of dynamic controls in a dropdown list box
    The code which I have used is

    TextBox txtbox = new TextBox();
    Panel1.Controls .Add(txtbox);
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    You have posted your question in the "classic" ASP forum. Please tell me what language you are using and I will move your thread to the correct forum.

    Jared

    Comment

    • raghulvarma
      New Member
      • Oct 2007
      • 90

      #3
      I am using C# in my asp page.I got to know how to remove the panel from being displayed,it is just by clicking over it and by clearing the text we could remove the text "panel" which is being displayed

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        Originally posted by raghulvarma
        I am using C# in my asp page.I got to know how to remove the panel from being displayed,it is just by clicking over it and by clearing the text we could remove the text "panel" which is being displayed
        You can not write ASP with C#, that was added in ASP.NET. I'll move you over to the .NET forum. Happy coding.

        Jared

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          Originally posted by raghulvarma
          I am using C# in my asp page.I got to know how to remove the panel from being displayed,it is just by clicking over it and by clearing the text we could remove the text "panel" which is being displayed
          When you add the panel to the ASP.NET page text is automatically added to it.
          I don't know why they do that but you're going to have to delete the word "panel" from your panel.
          eg:
          Change
          [code=asp]
          <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px">
          panel
          </asp:Panel> [/code]
          To be
          [code=asp]
          <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px">
          </asp:Panel> [/code]
          It's that simple.

          Comment

          • raghulvarma
            New Member
            • Oct 2007
            • 90

            #6
            Now I have a big problem,
            As I have created only one object for the textbox and that particular textbox is being repeated as many times I want But if I want to add the values in the database from each and every textbox which have been dynamically created how should I do that?
            Let me explain with my real time scenario , For example if customer-1 has 2 telephone lines and customer-3 has 3 telephone lines then the textbox ate displayed as required but how to add these values to DB from dynamically created textboxes?
            thanx in advance

            Comment

            • Frinavale
              Recognized Expert Expert
              • Oct 2006
              • 9749

              #7
              Originally posted by raghulvarma
              Now I have a big problem,
              As I have created only one object for the textbox and that particular textbox is being repeated as many times I want But if I want to add the values in the database from each and every textbox which have been dynamically created how should I do that?
              Let me explain with my real time scenario , For example if customer-1 has 2 telephone lines and customer-3 has 3 telephone lines then the textbox ate displayed as required but how to add these values to DB from dynamically created textboxes?
              thanx in advance
              When you create the TextBox, you should populate it's value from the database

              Get the phone lines from the database.
              Loop through the phone lines, and for each phone line create a text box.
              As you're looping through the phone lines,set the TextBox's Text value to the phone line. Then add the TextBox to the web page (I'm assuming that you are adding it to the Panel control).

              -Frinny

              Comment

              Working...