ASP.net VB.net Set dynamically added TextBox to stretch accross screen
Hi. I add a text box to my ASP.net panel using the following code. The CssClass used is in my Site.css file. The TextBox doesn't stretch across the width of the page as I would expect
Dim tb As New TextBox
tb.ID = "Control" 1
tb.CssClass = "xTextBoxHundredPercent"
Me.Panel_Controls.Controls.Add(tb)
Here is the class
.xTextBoxHundredPercent {
width: 100%;
}
ASP.NETVisual Basic.NET
Last Comment
Murray Brown
8/22/2022 - Mon
Ramkisan Jagtap
May be your panel has fixed width, so your child control will get the 100% width of its parent i.e. panel where you have added the button. If possible can you please post you full code here?
Murray Brown
ASKER
Hi. I thought of that and tried the following code but it didn't work. See my Markup for the page below
Me.Form.Controls.Add(tb)