System.Net.WebException: The remote server returned an error: (500)

I am getting a an error 


The remote server returned an error: (500) Internal Server Error.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
Source Error:

Line 45: response.write ("Hello I am here First")
Line 46: wRequest.Headers.Add("Man", "GET " & URL)
Line 47: wResponse = wRequest.GetResponse()
Line 48: ' wResponse = CType(wRequest.GetResponse, System.Net.WebResponse)
Line 49: If wRequest.HaveResponse Then

Source File: C:\Inetpub\wwwroot\WebApplication1\index1.aspx Line: 47
Stack Trace:

[WebException: The remote server returned an error: (500) Internal Server Error.]
System.Net.HttpWebRequest.CheckFinalStatus() +674
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) +139
System.Net.HttpWebRequest.GetResponse() +147
ASP.index1_aspx.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\WebApplication1\index1.aspx:47
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

This is the subroutine:

  sub Page_Load(sender as object, e as Eventargs)
  Dim wRequest As System.Net.HttpWebRequest
Dim wResponse As System.Net.HttpWebResponse
Dim StreamHandler As System.IO.StreamReader
Dim xmlDoc As New System.Xml.XmlDocument


' Send the request to the server
response.write ("Hello I am here now")
Try
Dim URL As String = "http://localhost/aspnet/process.aspx"
wRequest = System.Net.WebRequest.Create(URL)
response.write ("Hello I am here First")
wRequest.Headers.Add("Man", "GET " & URL)

wResponse = CType(wRequest.GetResponse, System.Net.WebResponse)
If wRequest.HaveResponse Then
response.write ("Hello I am here")
If wResponse.StatusCode = Net.HttpStatusCode.OK Then
streamHandler = New System.IO.StreamReader(wResponse.GetResponseStream())
xmlDoc.LoadXml(StreamHandler.ReadToEnd)
MsgBox("[--------" & xmlDoc.InnerText & "-------]")
End If
End If
'Catch ex As System.Net.WebException
Finally
End Try
end sub
0
TheNewGirl
8/10/2004 7:44:26 PM
asp.net.xml-datasource 7181 articles. 0 followers. Follow

0 Replies
1902 Views

Similar Articles

[PageSpeed] 13

Reply:

Web resources about - System.Net.WebException: The remote server returned an error: (500) - asp.net.xml-datasource

Resources last updated: 1/19/2016 1:14:19 AM