|
WantToLearn -> RE: what's wrong with my path (5/31/2007 15:56:04)
|
quote:
ORIGINAL: WantToLearn Give this a try: Eval("Picture", "~/photos/{0}") Here's an attempt to explain why the above code works. The Eval statement can take a second parameter that will format the output and can be used to combine the value with other text. So, in the example above, Eval replaces the {0} with the value in "picture". Why {0}? It is the same used in ASP.NET formatting functions which you can read more about here. There are several common, built-in formats you can use. For example, if you want to format the field as currency, you can use the built-in currency format "{0:C}" like so: <%# Eval("Price", "{0:C}") %> You can then combine the currency formatted field with other text like so: <%# Eval("Price", "Special Offer {0:C} for Today Only!") %> Below are some links for futher reading. MSDN Formatting Overview MSDN Composite Formatting Simplified and Extended Data Binding Syntax in ASP.NET 2.0
|
|
|
|