How to connect to external URL from mvc application
<p>How can i call a external URL from MVC application. </p>

<p>I have an intranet application where i can have a search facilty to find the details by providing a student name. The search returns an html page with the details of the student .</p>

<p>My MVC web application has a page where i can provide a student name. My requirement is if i provide student name  a search should happen with the external URL (which i specified above) and want to populate my MVC view with details from the external URL .  </p>

<p>For example if i give name swathi in my mvc application on change of the text box it should connect to the external URL (the search URL) and the remaining field need to populate from the result of the external URL (result is in html format). say my external URL returns Date of BIrth,address,emailid for my name "swathi"  ,so my mvc application with search for "Date of BIrth" and find the corresponding value and should populate my mvc razor view.</p>

<pre><code>Edit: Tried as below
$("#Contactname").change(function () {
       $.ajax({
            url: 'http://XXXXX.intranet.group/Pages/PeopleResults.aspx?k=swath&amp;exact=true',  
            type: 'GET',
            crossDomain: true,
            contentType: "text/html; charset=utf-8",
            success: function (data, textStatus, xhr) {
               alert(1)
            },
            error: function (jqXHR, exception) {
                if (jqXHR.status === 0) {
                    alert('1Not connect.\n Verify Network.');
                }
            }
        });
    });
</code></pre>

<p>here i am getting jqXHR.status = 0 error.</p>