【问题标题】:Navigate Url, Hyperlink Button导航 URL,超链接按钮
【发布时间】:2011-12-03 01:53:38
【问题描述】:

我试图在我的导航 URL 中传递两个参数以在我的 download.aspx 文件中请求它们。

我总是收到这个错误...

Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

这是我的代码:

HL.NavigateUrl = String.Format("downloading.aspx?path={0}&file={1}" + GetTheCurrentDirectory(selectedNodeValue) + fri.Name);

我不知道为什么会出现此错误...有人可以帮助我吗?

非常感谢。

【问题讨论】:

    标签: c# asp.net file-upload hyperlink


    【解决方案1】:

    改为这样做:

    HL.NavigateUrl = String.Format("downloading.aspx?path={0}&file={1}", GetTheCurrentDirectory(selectedNodeValue), fri.Name);
    

    带有String.Format的参数应该是方法调用的单独参数,或者干脆去掉String.Format:

    HL.NavigateUrl = "downloading.aspx?path={0}&file={1}" + GetTheCurrentDirectory(selectedNodeValue) + fri.Name;
    

    【讨论】:

      猜你喜欢
      • 2016-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多