Search code examples
asp.nettextboxpaneljustify

ASP.NET Panels & Dynamic Controls


I have a simple form, with a table (from the standard toolbox - 3 X 4). In one of the cells I have a panel, which I add textboxes to dynamically at runtime.

Problem is this: How can I have the panel LEFT-justified in the cell, yet have my textboxes RIGHT-justified within the panel? (and, possibly the text right-justified inside the textboxes)

Any thoughts would be greatly appreciated!

Thanks, Jason


Solution

  • Set the panels's HorizontalAlign property to HorizontalAlign.Right

    As for the TextBox, you can do

    dynamicTextBox.Style.Add("text-align", "right");