导航Url,超链接按钮

本文关键字:按钮 超链接 Url 导航 | 更新日期: 2023-09-27 18:16:24

我试图在我的导航URL中传递两个参数,以请求他们在我的下载。

我总是得到这个错误…

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);

我不知道为什么我得到这个错误…有人能帮我吗?

非常感谢。

导航Url,超链接按钮

改为:

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

带String的参数。Format应该是方法调用的单独参数,或者移除String。格式完全:

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