多次刷新Aspx页面时出现错误503

时间:2018-11-02 09:42:54

标签: c# asp.net runtime-error page-refresh

当我几次刷新或Ctrl + 5时连续抛出此错误。请帮助我...!

enter image description here

实际错误是 enter image description here

实际上Iam在我的JS中使用一个URL来获取Ip ...继续刷新页面时,它无法获取我认为的Ip。因此它显示了错误。

这是代码如何获取IP

string url = string.Format("http://api.ipinfodb.com/v3/ip-city/?key={0}&ip={1}&format=json", APIKey, ipAddress);
using (WebClient client = new WebClient())
{
    string json = client.DownloadString(url);
    Location location = new JavaScriptSerializer().Deserialize<Location>(json);

2 个答案:

答案 0 :(得分:1)

设置web.config文件此代码。

确保将customErrors标记嵌套在 标记内的某个位置,如下所示:

<system.web>
<customErrors mode="Off" />
</system.web>

答案 1 :(得分:1)

此黄页指出存在运行时错误。在中关闭自定义错误模式 Web配置文件<CustomErrors mode="Off">,并重现相同的场景。您将在页面上看到实际的错误。但是不要在生产中使用。