vb.net .vb How to put HtmlElement into string format ?

asked 2020-08-30T18:25:14.647+00:00
vmars316 621 Reputation points

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 :

Thanks for your help...

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,314 questions
No comments
{count} votes

Accepted answer
  1. answered 2020-08-31T06:02:54.153+00:00
    Viorel 82,286 Reputation points

    To solve the error, try MsgBox("Current Link = " & link.OuterHtml).

1 additional answer

Sort by: Most helpful
  1. answered 2020-08-31T05:34:28.633+00:00
    Daniel Zhang-MSFT 9,471 Reputation points

    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

    No comments