开发者

Can you make NavigateUrl direct to a page with a dynamic parameter appended to the URL?

开发者 https://www.devze.com 2023-04-10 21:46 出处:网络
I am trying to append something from an object onto a URL so that I can make a pa开发者_C百科rameter out of it. The goal is to do something like this:

I am trying to append something from an object onto a URL so that I can make a pa开发者_C百科rameter out of it. The goal is to do something like this:

articleview.aspx?Name=AwesomeSauce

Where I could use the Name parameter on the page I'm directing toward.

I have some code here:

<asp:hyperlink Text=<%# DataBinder.Eval(Container.DataItem, "Title") %> NavigateUrl="ArticleView.aspx" </asp:hyperlink> 

But I'm not sure how I could add the "?Name={variable}" part on the end. Can anyone help me out? I'm sure it's something simple that I'm missing.


Try something like this:

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# String.Format("ArticleView.aspx?Name={0}", Eval("SomeName"))%>' ... />
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号