1

I have an input like this :

<input type="hidden" name="myname" id="myid" value='myvalue' />

How can I get myvalue from this input using HTML Agility pack?

I'm using C# and HTML Agility pack. I tried this :

var latlon = mydetails.DocumentNode.QuerySelector("#myname").QuerySelector("input");

But this didn't work. Thanks.

jason
  • 6,962
  • 36
  • 117
  • 198

1 Answers1

-1

I am not sure where you want to recieve the input value but maybe this will help you if want to recieve it at server side.

Change your tag as following : input type="hidden" runat="server" name="myname" id="myid" value='myvalue' />

after that you can access the variable "myid" anywhere in aspx.cs file

Sanjay
  • 1
  • 2