Simple C# Question about moving something to a new line

Posted on 2009-12-31
Last Modified: 2012-05-08
Hey I am not very familiar with c# at all, but I have a form that I am using as a contact form in Sharepoint as a webpart. All I am wanting to do is separate the text box labels and text boxes on to different lines. Attached is the code that handles the main label at the top (which is fine) and the first row which I want to put on two lines. I know this has to be very simple. Let me know if there is anymore information you need and I will respond quickly.

Thanks in advance!


            Table t;
            TableRow tr;
            TableCell tc;

            // A table that is used to layout the controls
            t = new Table();

            // Label with instructions for the user
            tr = new TableRow();
            tc = new TableCell();
            tc.ColumnSpan = 2;
            tc.VerticalAlign = VerticalAlign.Top;
            Label lblInstructions = new Label();

            lblInstructions.Text = "<br>Did a team member of the hospital go above and beyond for you or someone else?<br/>" +
                                   "Did they help a guest or a peer have a pleasant and enjoyable experience at xxxxx " +
                                   "<br>xxxxx xxxxx xxxxx xxxx? If so, and you would like to show your appreciation <br/>" +
                                   "towards this person, please tell us what they did for you or someone else. " +
                                   "<br>Fill out this form and tell us their name and information about what you experienced. <br/>" +
                                   "That way, we can recognize this person's good efforts throughout the hospital." +
                                   "<br> <br/>";


            // Contact Name label
            tr = new TableRow();
            tc = new TableCell();
            tc.Style["padding-top"] = "7px";
            tc.VerticalAlign = VerticalAlign.Top;
            Label lblContactName = new Label();
            lblContactName.Text = "Name of the team member:";

            // Contact Name textbox
            tc = new TableCell();
            tc.VerticalAlign = VerticalAlign.Top;
            txtContactName = new TextBox();
            txtContactName.ID = "txtContactName";
            txtContactName.Width = Unit.Pixel(300);

Open in new window

Question by:armfull
    1 Comment

    Accepted Solution

    Never mind I figured it out. I had forgot to add the t.Controls.Add(tr); when I edited then label

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    745 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

    16 Experts available now in Live!

    Get 1:1 Help Now