简体   繁体   中英

Add multiple parameters in URL asp.net

I am currently trying to send 2 parameters through an URL in ASP.NET. I have been able to successfully send across 1 parameter. I am now wanting to learn how to send 2 across.

I am wanting to also send another ID as well that links to Favourite_ID similar to what is happening below with Recipe_ID

ASP.NET

<asp:HyperLink Runat ="server" NavigateUrl ='<%#"RecipePage?id=" + DataBinder.Eval(Container.DataItem, "Recipe_ID").ToString()%>' ID="Hyperlink1"><%#DataBinder.Eval(Container.DataItem, "Recipe_Name")%></asp:HyperLink></asp>
<asp:HyperLink Runat ="server" NavigateUrl ='<%#"RecipePage?id=" + DataBinder.Eval(Container.DataItem, "Recipe_ID").ToString()+"&YourId="+DataBinder.Eval(Container.DataItem, "YourId")%>' ID="Hyperlink1"><%#DataBinder.Eval(Container.DataItem, "Recipe_Name")%></asp:HyperLink></asp>

您可以将您的ID名称替换为YourId,并可以添加多个ID(如上所述)

<asp:hyperlink
runat="server"
id="hlReceipt"
navigateurl='<%# String.Format("RecipePage.aspx?id={0}&name={1}", Eval("Receipt_ID"), Eval("Receipt_Name")) %>'
text='<%# Eval("Receipt_title") %>'>
</asp:hyperlink>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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