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

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

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...

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

Accepted answer
  1. Viorel 116.6K Reputation points
    2020-08-31T06:02:54.153+00:00

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


1 additional answer

Sort by: Most helpful
  1. 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

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.