Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9285549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:11:40+00:00 2026-06-18T19:11:40+00:00

Need some advice. I’ve setup the following HttpWebRequest, which goes over to another server

  • 0

Need some advice. I’ve setup the following HttpWebRequest, which goes over to another server and retrieves data from there in htnl format – but I can change this to another structre.

What I would like to do is databind the data from there and present it nicely using repeaters and a list control in my website.

I’ve got most of code here below. The question I need to ask is, can I databind my responseData object the way I’ve got it setup. Secondly, I can configure the page at the other end to produce output in most formats. If I have customername,contact,telephone,email, how shall I present structure wise so I can use it as a databind object?

Hope the question makes sense. Thanks as always

    string url = "https://myaddress/customerlist.php";

    // creates the post data for the POST request
    string postData = "ID=" + username + "&Token=" + token;

    // create the POST request
    HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
    webRequest.Method = "POST";
    webRequest.ContentType = "application/x-www-form-urlencoded";
    webRequest.ContentLength = postData.Length;

    // POST the data
    using (StreamWriter requestWriter2 = new StreamWriter(webRequest.GetRequestStream()))
    {
        requestWriter2.Write(postData);
    }

    //  This actually does the request and gets the response back
    HttpWebResponse resp = (HttpWebResponse)webRequest.GetResponse();

    string responseData = string.Empty;

    using (StreamReader responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream()))
    {
        // dumps the HTML from the response into a string variable
        responseData = responseReader.ReadToEnd();
    }

    ReportRepeater.DataSource = responseData;
    ReportRepeater.DataBind();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T19:11:41+00:00Added an answer on June 18, 2026 at 7:11 pm

    you should transform responseData in a list of custom object in order to bind it to the repeater

    IList<Contact> contacts = ParseResponse(responseData);
    
    ReportRepeater.DataSource = contacts;
    ReportRepeater.DataBind();
    

    Where ParseResponse is a custom method like this:

    IList<Contact> ParseResponse(string response)
    {
       var rtn = new List<Contact>();
    
       //some loop to create contacts
       //rtn.Add(newContact);
    
       return rtn;
    }
    

    A good explanation to how use repeater:
    http://msdn.microsoft.com/en-us/magazine/cc163780.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some advice in the following matter: I have a QT project, which
This question is an extension from another question of mine @ Need some advice
I need some advice regarding which database I should use. I want to create
I need some advice of how to setup my tables I currently have a
I need some advice for a design which I have to implement in application.
I need some advice on which Swing Components to choose in order to achieve
I need some advice from experts :) I will develop a website using PHP
I need some advice on techniques to perform page redirect in asp.net. Which one
I need some advice on which library is the best choice when it comes
I need some advice on modelling my data tables. I need to apply inheritance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.