Textbox is disabled after adding text dynamically in codebehind
- by user1761348
Can't quite work out what is happening but The background is that I am dynamically adding table rows in a web page and some of the cells hold controls such as dropdowns etc. One of the columns pulls a size into it.
However the column I am having issues with is the next column which takes the text from teh previous dropdown and shows the appropriate price. On doing htis however the textbox which is being created appears to turn into a label as I cannot select or adjust the text that has been put in there.
var gotPrice =(from a in getPrice.Sizes
where a.Size1 == Size.SelectedValue
select a).First();
TextBox Price = new TextBox();
Price.Width = 100;
PriceField.Controls.Add(Price);
PriceField.Text = gotPrice.RackRate.ToString();
I have tried then calling .Enabled but still the text box is not editable.
any help appreciated.