Link to home
Start Free TrialLog in
Avatar of armfull
armfull

asked on

Simple C# Question about moving something to a new line

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!


base.CreateChildControls();

            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/>";
            tc.Controls.Add(lblInstructions);
            tr.Controls.Add(tc);

            t.Controls.Add(tr);

            // 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:";
            tc.Controls.Add(lblContactName);
            tr.Controls.Add(tc);
            
            
            

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

Open in new window

screencapture.PNG
ASKER CERTIFIED SOLUTION
Avatar of armfull
armfull

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial