To obtain data from an ashx page, use the following methods:
1.
BackgroundCode: WebClient WC=NewWebClient (); byte [] pagedata= WC. downloaddata ("Http://xxxx.com"); Hd_num.value=Encoding. Default. getstring (pagedata); front-end code:<Asp: hiddenfield id ="Hd_num"Runat ="Server"/>Then obtain the value of hd_num through Js.
2.
Httpwebrequest request = httpwebrequest. Create ("Http: // xxx/AAA. ashx")AsHttpwebrequest; httpwebresponse response= Request. getresponse ()AsHttpwebresponse; stream resstream=Response. getresponsestream (); streamreader SR=NewStreamreader (resstream, system. Text. encoding. Default );//The encoding can be changed to another one.Contenthtml. Text= Sr. readtoend ();
3.
You can also use Ajax cross-origin requests. This part is still being studied .... The data that has been processed is transmitted from my ashx page ....