调用方法时从页面加载事件中获取错误 [英] getting error from page load event while calling method

查看:73
本文介绍了调用方法时从页面加载事件中获取错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

i当我尝试运行我从页面加载事件调用的方法时出现此错误,这是错误来自的地方;



Hi all,
i am getting this error when i try to run a method which i am calling from my page load event, this is where the error is coming from;

protected void Page_Load(object sender, EventArgs e)
  {
      EnvironmentSpecificRequestUrl();
  }
  private void EnvironmentSpecificRequestUrl()
  {
      throw new NotImplementedException();
  }







这是我的代码:






here is my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class test123 : System.Web.UI.Page
{


    protected void Page_Load(object sender, EventArgs e)
    {


        EnvironmentSpecificRequestUrl();
    }
  
    public static Uri EnvironmentSpecificRequestUrl(HttpRequestBase request)
    {
//.........
//........
    }
}





请告诉我错误的地方。



谢谢提前



please let me know where am stuck up the error.

thanks in advance

推荐答案

我不确定你说的实际错误是什么,但我在你的代码片段中看到两个问题。



在第一个块中,你抛出一个 NotImplementedException ,这本身就是错误的(故意)原因。


在第二个块中,签名: public static Uri EnvironmentSpecificRequestUrl(HttpRequestBase request)与您调用的签名不匹配with,没有参数。
I'm not sure you stated what the actual error is, but I see two problems in your code snippets.

In the first block, you are throwing a NotImplementedException, which not surprisingly is itself the (intentional) cause of the error.

In the second block, the signature: public static Uri EnvironmentSpecificRequestUrl(HttpRequestBase request) does not match the signature that you are calling with, which has no arguments.


这篇关于调用方法时从页面加载事件中获取错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆