I see, your last message hints that the problem is that the in memory DOM that LTAF works against was not updated between different renderings of the control.
This is by design, since there is no way for LTAF to know that it should go a retrieve the DOM again, that is why it works when you refresh the element (which tells LTAF to go and grab the latest DOM from the browser).
david4chao
Member
5 Points
6 Posts
How to settext to HtmlTextAreaElement
Oct 06, 2009 02:03 PM|LINK
I have an HtmlTextAreaElement which I want to set text.
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> HtmlTextAreaElement _ControlOfsummary = (HtmlTextAreaElement)_ContainerOfControlOfsummary.ChildElements.Find("ControlID_Prefix_Editor_FreeTextBox_summary");</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> _ControlOfsummary.SetText("Test string 111111111111111");</div> <div></div>HtmlTextAreaElement _ControlOfsummary = (HtmlTextAreaElement)_ContainerOfControlOfsummary.ChildElements.Find("summary");
_ControlOfsummary.SetText("Test string");
It is not working.
<div></div>
child elements
karthicks
All-Star
32142 Points
5528 Posts
Re: How to settext to HtmlTextAreaElement
Oct 07, 2009 04:05 AM|LINK
in server you can do like this.TextArea1.Value = "text"; ( to access this control @ server-side it should have runat="server")
in client-side - document.getElementById('TextArea1').value='text';
Karthick S
farmas
Participant
1164 Points
259 Posts
Microsoft
Re: How to settext to HtmlTextAreaElement
Oct 07, 2009 05:23 AM|LINK
Interesting. I will try to repro this tomorrow and let you know what I find.
- Federico
david4chao
Member
5 Points
6 Posts
Re: How to settext to HtmlTextAreaElement
Oct 07, 2009 01:55 PM|LINK
Can you try Asp.Net QA api?
Thanks.
child elements
farmas
Participant
1164 Points
259 Posts
Microsoft
Re: How to settext to HtmlTextAreaElement
Oct 09, 2009 05:25 AM|LINK
I tried this in the office today but I could not get to repro the problem.
I have a page with <textarea id="textarea"></textarea> and my test looks like this:
[WebTestMethod]
public void TypeOnATextArea()
{
HtmlPage page = new HtmlPage("Login.aspx");
page.Elements.Find("textarea").SetText("foobar");
}
After running in FireFox I see the text in there. If you are still seeing this problem, could you provide some more details?
- Federico
osbornm
Participant
914 Points
196 Posts
Microsoft
Re: How to settext to HtmlTextAreaElement
Oct 14, 2009 07:03 AM|LINK
I am unable to repro this issue aswell... Can you post a repro please
http://blog.osbornm.com
http://www.codingqa.com
http://weblogs.asp.net/asptest
"Change the world or go home."
david4chao
Member
5 Points
6 Posts
Re: How to settext to HtmlTextAreaElement
Oct 14, 2009 04:14 PM|LINK
When switch between EditItemTemplate and ItemTemplate of GridView, sometimes, cannot set to the TextArea.
Refrshing parent HtmlElement will solve the problem.
forms
farmas
Participant
1164 Points
259 Posts
Microsoft
Re: How to settext to HtmlTextAreaElement
Oct 16, 2009 12:21 AM|LINK
I see, your last message hints that the problem is that the in memory DOM that LTAF works against was not updated between different renderings of the control.
This is by design, since there is no way for LTAF to know that it should go a retrieve the DOM again, that is why it works when you refresh the element (which tells LTAF to go and grab the latest DOM from the browser).
- Federico
shakatreh
Member
16 Points
19 Posts
Re: How to settext to HtmlTextAreaElement
Jan 26, 2010 11:05 PM|LINK
Thank you very very very very very very very very very much..
Karthicks You are great man.