To solve the error, try MsgBox("Current Link = " & link.OuterHtml).
vb.net .vb How to put HtmlElement into string format ?
vb.net .vb How to put HtmlElement into string format ?
Hello & Thanks ;
I am trying to show the current link to see if it has been changed :
MsgBox("Current Link = ", link)
But evidently link is not the proper type .
Error msg: Form1.vb(28,44): error BC30311: Value of type 'HtmlElement' cannot be converted to 'MsgBoxStyle'.
How to put HtmlElement in proper format ?
Sorry , your system would't allow me to post code because
" file references and URL injection type strings" , and it wouldn't allow a snap shot of code even though it is only 77kb , and it wouldn't allow me to click on paperclick icon .
So I Posted pic here :
http://vmars.us/VB-Net-Forums/devenv_RGJMSsMHoN.png
Thanks for your help...
1 additional answer
Sort by: Most helpful
-
Daniel Zhang-MSFT 9,626 Reputation points
2020-08-31T05:34:28.633+00:00 Hi Vernon Marsden,
>>I am trying to show the current link to see if it has been changed
HtmlElement represents any possible type of element in an HTML document, such as BODY, TABLE, and FORM, among others.
The class exposes the most common properties you can expect to find on all elements.
So you can access to attributes, properties to judge if it has been changed instead of outputting html directly.
Such as, you can use HtmlElement.GetAttribute(String) method to retrieve the value of the named attribute on the element.
You can also use HtmlElement.InnerText property to get the text assigned to the element.
Best Regards,
Daniel Zhang