如何使用Forms.WebBrowser通过C#将文本插入textarea [英] How to insert text into textarea through c# with Forms.WebBrowser

查看:118
本文介绍了如何使用Forms.WebBrowser通过C#将文本插入textarea的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有以下HTML:

 <   html  > ; 
    <  正文 > 
       <   textarea     ="   foo" <   > 
    <  /body  > 
<  /html  >  


如何通过 C# HtmldocumentText插入到TextArea中?
SetAttribute()方法不起作用,因为TextArea
没有没有值字段 那么如何通过C#将Text 插入到TextArea中呢?

任何建议都将不胜感激!

预先感谢.

解决方案

< textarea id = "  foo" runat =  服务器" >  </  textarea  > 


然后使用此适当的InnerText
对于HTML标记,请使用InnerHtml

 foo.InnerText = " ; 


查看此处, http://stackoverflow.com/questions /4508051/textarea-control-asp-net-c-sharp [ ^ ]


Suppose I had the following HTML:

<html>
    <body>
       <textarea id="foo"></textarea>
    </body>
</html>


How to insert Text into the TextArea through C# Htmldocument?
The SetAttribute() method is not working as there is no value field for TextArea
So how to insert Text into TextArea through C#?

Any advice is much appreciated!

Thanks in advance.

解决方案

<textarea id="foo" runat="server"></textarea>


Then use this propriety InnerText
and for applying HTML tags use InnerHtml

foo.InnerText = "  ";


Look here, http://stackoverflow.com/questions/4508051/textarea-control-asp-net-c-sharp[^]


这篇关于如何使用Forms.WebBrowser通过C#将文本插入textarea的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆