p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   .NET Framework 2.0 (http://p2p.wrox.com/forumdisplay.php?f=141)
-   -   How to Bind Two Variables to LinkButton Control (http://p2p.wrox.com/showthread.php?t=71231)

cyberstore05 October 28th, 2008 06:02 PM

How to Bind Two Variables to LinkButton Control
I need to bind more than one parameter to a LinkButton's PostBackUrl property using the EVAL() method. I am trying to pass two parameters from one web page to another. The expression I have tried to compose is something like this: PostBackUrl ='<%#"Page1.aspx?PriceSearch=" & Eval("Price") %>'>

The above works for one parameter. Adding a second parameter like this the following does not work:
PostBackUrl ='<%# Eval("Price", "Page1.aspx?PriceSearch={0}") + "&=RangeSearch" _
+ Request.QueryString("Range")%>'>

In effect the two parameters I want to pass are "Price" and "Range".
Any help will be appreciated.

Imar October 31st, 2008 02:50 AM

Hi there,

You shouldn't Eval the whole thing, but only the parts that come from the database. E.g.:

Eval("Column1").ToString() + "Something" + Eval("Column2").ToString()

Hope this helps,


Imar Spaanjaars
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.

All times are GMT -4. The time now is 05:37 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.