I have a Chat div that contains an UpdatePanel with two dynamically divs added to it. The first div contains the text area:
HtmlGenericControl div = new HtmlGenericControl("div");
The div that contains the TextBox + Button is created like this:
HtmlGenericControl divTxt = new HtmlGenericControl("div");
divTxt.Attributes.Add("style", "position:fixed;bottom:0px;");
Then i add them to the UpdatePanel:
upl.ContentTemplateContainer.Controls.Add(div);
upl.ContentTemplateContainer.Controls.Add(divTxt);
Then i add it to the divChat (container):
divChat.Controls.Add(upl);
It is all working great, the last line is inserted after the previous one, the text is disappearing when it reaches the top of the divChat. The problem is that the text in the div goes behind the divTxt when divChat is full of text (the last inserted line always is unreadable until another line is inserted because it stays behind the divTxt (the TextBox + Buton div)).
How can i make the last inserted line stay ABOVE the divTxt?
UPDATE: With divTxt position:relative and a Focus() on the TextBox+Button div it's almost doing the job, the odd thing is that the divTxt starts in the top of the divChat and only "sticks" in the bottom when it's full of text.