Textbox - how to programatically create a textbox with scolling and vertical alignment top

I need to programatically create a System.Web.UIControls.text box with scrolling and vertical alignment top...  

TextBox txt = new TextBox();
 txt.Height = 200;

.... want next?
thx
LVL 1
JElsterAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Johny BravoCommented:
>>with scrolling and vertical alignment top

Scrolling? Do you want a textarea?

vertical alignment top? Of which?
0
Jitendra PatilSr.Software EngineerCommented:
try the code below.
.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="TestWebApplication.Test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:Panel ID="PnlTest" runat="server" Width="100%">
    </asp:Panel>
    </form>
</body>
</html>

Open in new window

.cs code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data; 
namespace TestWebApplication
{
    public partial class Test : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                TextBox Txt = new TextBox();
                Txt.TextMode = TextBoxMode.MultiLine;
                Txt.Columns = 10;
                Txt.Rows = 10; 
                Txt.Text = "I am new textbox";
                PnlTest.Controls.Add(Txt);    
            }
        }
    }
}

Open in new window

hope this helps.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.