To get the data from a ashx page, use the following methods:
1.
Copy Code code as follows:
WebClient WC = new WebClient ();
byte[] Pagedata = WC. Downloaddata ("http://xxxx.com");
Hd_num. Value = Encoding.Default.GetString (pagedata);
Foreground code: <asp:hiddenfield id= "Hd_num" runat= "Server"/>
And then through JS to get the value of Hd_num.
2.
Copy Code code as follows:
HttpWebRequest request = Httpwebrequest.create ("Http://xxx/aaa.ashx") as HttpWebRequest;
HttpWebResponse response = Request. GetResponse () as HttpWebResponse;
Stream Resstream = Response. GetResponseStream ();
StreamReader sr = new StreamReader (Resstream, System.Text.Encoding.Default); The code can be changed to something else.
Contenthtml.text = Sr. ReadToEnd ();
3.
You can also use AJAX Cross-domain requests, which are still in the study, I don't know.
My main ashx page is the data that has been processed.