简体   繁体   English

ASP.NET超链接绑定多个URL参数

[英]ASP.NET Hyperlink binding multiple URL parameters

i got this code: 我得到了这段代码:

http://localhost:52182/ReviewRequest.aspx?requestid=254351496

where the setting behind it in the asp.net page is: 在asp.net页上它后面的设置是:

     <asp:HyperLinkField
                DataNavigateUrlFields="Request_No"
                DataNavigateUrlFormatString="ReviewRequest.aspx?requestid={0}"
                 DataTextField="Request_No"
                 HeaderText="Access Request"
                 DataTextFormatString="Review Request"
                 SortExpression="Request_No" />

the question is: in the DataNavigateUrlFormatString property in code above, what is the {0} stand for? 问题是:在上面代码的DataNavigateUrlFormatString属性中,{0}代表什么? and I want to pass another dynamically set parameter in the same URl so to look like this 我想在同一个URl中传递另一个动态设置的参数,所以看起来像这样

http://localhost:52182/ReviewRequest.aspx?requestid=254351496&nid=xxxxxx

how can I do so? 我该怎么办?

Thanks, and help is appreciated 谢谢,感谢您的帮助

The {0} is the zero indexed value of the fields you have mentioned in DataNavigateUrlFields . {0}是您在DataNavigateUrlFields提到的字段的零索引值。 You can pass the next field as 您可以将下一个字段传递为

 <asp:HyperLinkField
                DataNavigateUrlFields="Request_No, NID"
                DataNavigateUrlFormatString="ReviewRequest.aspx?requestid={0}&nid={1}"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM