在asp.net vb.net中使用WebClient.DownloadString时出错

在asp.net vb.net中使用WebClient.DownloadString时出错,asp.net,vb.net,sendmail,Asp.net,Vb.net,Sendmail,我正在使用vb.net中的WebClient.DownloadString方法将asp.net页面转换为字符串,然后通过电子邮件发送此字符串。 我从服务器上得到了这个错误 The remote server returned an error: (500) Internal Server Error. 不幸的是,没有关于错误的更多细节。可能的问题是什么 编辑: 以下代码行中出现错误: Dim str As String = client.DownloadString(Request.Url.

我正在使用
vb.net
中的
WebClient.DownloadString
方法将asp.net页面转换为字符串,然后通过电子邮件发送此字符串。 我从服务器上得到了这个错误

The remote server returned an error: (500) Internal Server Error. 
不幸的是,没有关于错误的更多细节。可能的问题是什么

编辑: 以下代码行中出现错误:

Dim str As String = client.DownloadString(Request.Url.GetLeftPart(UriPartial.Authority) + "/GFOPortalA/isd/ViewForm.aspx?ISD_FRM_NO=" + Session("ISD_ReqId"))

在web.config中,确保您有:

<webServices>
  <protocols>
    <add name="HttpGet"/>
    <add name="HttpPost"/>
  </protocols>
</webServices>


您能调试并查看错误发生在哪一行吗?抱歉,我不知道热调试:(在Visual studio中打开项目并点击F5)这不是发送电子邮件的错误。@ChamikaSandamal这是在什么地方?