简体   繁体   English

来自锚标记中传递的eval查询字符串的请求值

[英]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. 当我转到Booking.aspx时,链接看起来像这样。

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. 如果以上代码对您不起作用,请详细说明您的方案。

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

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