c# - WinForms WebBrowser ExecCommand CreateLink converts link to lowercase -


I have created an application that uses the HTML editor based on the web browser controller that is included in WinForms. When a link is added by the following function

  Public Zero Insertion Link (String URL) {webBrowser1.Document.ExecCommand ("CreateLink", false, url); }  

Result and When it was supposed to be & lt; A href = "http://youtu.be/JAXlk969MtQ" & gt; Text & lt; / A & gt; (with upper case letters) Is this the default behavior? Is there any way to stop this from happening?

You can use this code as a & lt; A & gt; Element in element instead of body or ExecCommand element:

  HtmlElement o = webBrowser1.Document.CreateElement ("a"); O.SetAttribute ("href", url); O Intrate = "text"; WebBrowser1.Document.Body.AppendChild (o); // or anHtmlElement.AppenChild (o);  

Comments