C# 导航Url,超链接按钮

C# 导航Url,超链接按钮,c#,asp.net,file-upload,hyperlink,C#,Asp.net,File Upload,Hyperlink,我试图在我的导航URL中传递两个参数,以便在我的downloading.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}" + GetTheCu

我试图在我的导航URL中传递两个参数,以便在我的downloading.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);
我不知道为什么我会犯这个错误。。。有人能帮我吗

多谢各位

改为这样做:

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;
改为这样做:

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;