简体   繁体   中英

Request value from eval query string passed in anchor tag

I passed three values as query string in an anchor tags as follows.

<a href='Booking.aspx?date=<%# Eval(" + calendar.Text + ")%>&hour=<%# Eval(" + i + ")%>&Id=<%# Eval(" + c.Id + ")%>'>Booking</a></td>";

When i go to Booking.aspx the link look likes this.

http://localhost:50115/AltaDeReserva.aspx?date=%3C%# Eval(08/07/2014)%>&hour=<%# Eval(17)%>&Id=<%# Eval(8)%>

But i don´t know how to request the values, i tried this but it does not work.

String date= Request.QueryString["date"].ToString();

Thank you in advance..

Please try with the below code snippet.

<a href='<%# string.Format("Booking.aspx?date={0}", Eval("date")) %>' />
//OR
<a href='<%# "Booking.aspx?date=" + Eval("date") %>' />

If above code is not worked for you then elaborate your scenario.

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