2011-06-24 212 views
2

我是新來的asp.net,我的公司有一個項目,所有這個項目devolopers離開這裏,沒有人知道這個項目。我需要更新它。 其實所有的都是在我的windowsXP系統本地配置的。數據庫,iis,項目文件都在這裏。遠程服務器返回一個錯誤:(500)內部服務器錯誤

當我使用網絡請求時出現錯誤 「遠程服務器返回錯誤:(500)內部服務器錯誤。」 錯誤和代碼在這裏 請幫我 的錯誤是

Server Error in '/ava-006' Application. 
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. 

異常詳細信息:System.Net.WebException:遠程服務器返回錯誤:(500)內部服務器錯誤。

源錯誤:

Line 50:   End If 
Line 51: 
Line 52:   wResp = wr.GetResponse 
Line 53:   sr = New System.IO.StreamReader(wResp.GetResponseStream) 
Line 54:   Shtml = sr.ReadToEnd 

源文件:F:\ Prajeesh \ AVA-006 \ lead.report.aging.aspx.vb行:52

堆棧跟蹤:

[WebException: The remote server returned an error: (500) Internal Server Error.] 
    System.Net.HttpWebRequest.GetResponse() +5375997 
    ava_006.lead_report_aging.GetReport(String strFormat, String strWeek) in F:\Prajeesh\ava-006\lead.report.aging.aspx.vb:52 
    ava_006.lead_report_aging.btnView_Click(Object sender, EventArgs e) in F:\Prajeesh\ava-006\lead.report.aging.aspx.vb:73 
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +107 
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3436 


Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618 

我用的是代碼爲

<pre lang="vb">Function GetReport(ByVal strFormat As String, ByVal strWeek As String) As String 
     Dim wr As WebRequest 
     Dim wResp As WebResponse 
     Dim sr As StreamReader 
     Dim Shtml As String 
     If InStr(Request.ServerVariables(&quot;path_info&quot;), &quot;ava-006&quot;) &gt; 0 Then 
      wr = HttpWebRequest.Create(&quot;http://&quot; &amp; Request.ServerVariables(&quot;server_name&quot;) &amp; &quot;/ava-006/lead.report.agingsub.aspx?pFormat=&quot; &amp; strFormat &amp; &quot;&amp;pWeek=&quot; &amp; strWeek) 
     Else 
      wr = HttpWebRequest.Create(&quot;http://&quot; &amp; Request.ServerVariables(&quot;server_name&quot;) &amp; &quot;/lead.report.agingsub.aspx?pFormat=&quot; &amp; strFormat &amp; &quot;&amp;pWeek=&quot; &amp; strWeek) 
     End If 
     wResp = wr.GetResponse 
     sr = New System.IO.StreamReader(wResp.GetResponseStream) 
     Shtml = sr.ReadToEnd 
     GetReport = Shtml 
    End Function</pre> 
+0

我認爲錯誤發生在您嘗試獲取數據而不是此代碼的服務器上。因此,您需要檢查您的遠程服務器是否實際嘗試獲取數據,並且數據位於您要求的位置。這是你需要檢查它的工作。 server_name // ava-006/lead.report.agingsub.aspx – Aristos

回答

0

在你的btnView_Click上放置一個斷點並查看發生異常的位置。

+0

Function GetReport中的實際斷點(...除非該代碼不是你的.. – ghimireniraj

1

錯誤是在你的頁面lead.report.agingsub.aspx 當其通pFormatpWeek其拋出錯誤,以便 其顯示500錯誤,因爲wr.GetResponse返回錯誤頁面,從鉛.report.agingsub.aspx

相關問題