|
| |
|
|
swoosh
Posts: 1437 Joined: 5/18/2002 From: Beaver Falls, PA Status: offline
|
what's wrong with my path - 5/25/2007 12:44:47
have a gridview results page in this directory: ROOT>>DOWNTOWN>>AMBRIDGE>>BUSINESS_DEVELOPMENT All works fine........then a link on this page to view the Details Page also in the same directory works fine. If I move the Details Page to the root.........it doesn't work, but it also doesn't work when I change the parameter link to look at the details page on the root. For example: When both were in the same directory, all I had to supply was this "details.aspx?Unit_ID={0} then I moved the details page to the root and changed the syntax to various paths such as this: ../../../details.aspx?Unit_ID=[0} The above path has been tried with various combiniatons BUT IT DOESN'T WORK, OBVIOUSLY MY PATH IS WRONG. DOES ANYONE KNOW WHAT IT SHOULD BE? am I way off the radar here?
_____________________________
Swoooosh Just Do It!
|
|
|
|
swoosh
Posts: 1437 Joined: 5/18/2002 From: Beaver Falls, PA Status: offline
|
RE: what's wrong with my path - 5/28/2007 22:21:03
Thanks a bundle WTL.....it works great, and so much easier too. Now for another path question if anyone has any suggestions: On my details page which is now working thanks to WTL. I have a picture to be displayed. When I edit the data bindings for this field I use a custom expression: It automatically reads EVAL("Picture") where picture is the name of the field in my database. This is obviously saying to take the value of this field. which the value is strictly the image name for example: swoosh.jpg However the pictures are in a folder named PHOTOS which is a subdirectory of the root........so I have tried the following: photos/& EVAL("Picture") ../photos & EVAL("Picture") ~/photos & EVAL("Pictue") I have used the above paths with quotes as well but nothing seems to work. If I have the photos in the same directory as the details page then it works or if I have the picture value have Photos/swoosh.jpg it works.....but I certainly do not want all the photos to be on the root nor do I want to have to add "PHOTOS" to the value of each record which is why I want to reference a Photos folder Here is the following Error Message I am receiving trying to use one of my previous attempts: Line 124: <br />
Line 125: Picture:
Line 126: <asp:Image runat="server" id="Image1" ImageUrl='<%# "~/photos/" & Eval("Picture") %>' />
Line 127: <br />
Line 128: </ItemTemplate> Can anyone see where I am screwing this up?
< Message edited by swoosh -- 5/28/2007 22:39:17 >
_____________________________
Swoooosh Just Do It!
|
|
|
|
WantToLearn
Posts: 109 Joined: 10/19/2002 Status: offline
|
RE: what's wrong with my path - 5/29/2007 10:00:09
Give this a try: Eval("Picture", "~/photos/{0}")
|
|
|
|
swoosh
Posts: 1437 Joined: 5/18/2002 From: Beaver Falls, PA Status: offline
|
RE: what's wrong with my path - 5/31/2007 10:38:53
quote:
Eval("Picture", "~/photos/{0}") It worked like a charm WTL!!! thanks AGAIN for your assistance. TAIL: Didn't get a chance to try yours, but I will and let this thread know if it worked, I appreciate your time and input.
_____________________________
Swoooosh Just Do It!
|
|
|
|
Tailslide
Posts: 6121 Joined: 5/10/2005 From: Out here on the raggedy edge Status: offline
|
RE: what's wrong with my path - 5/31/2007 11:41:35
My suggestion probably wouldn't work as it was a total blind guess and I know nothing about ASP!!
_____________________________
"My strategy is so simple an idiot could have devised it" Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
|
|
|
|
WantToLearn
Posts: 109 Joined: 10/19/2002 Status: offline
|
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
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|