1 Replies - 1035 Views - Last Post: 22 April 2011 - 01:38 PM Rate Topic: -----

#1 cutedevils   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 22-April 09

problem in displaying all images contained in a folder

Posted 21 April 2011 - 02:12 PM

i am trying to retrieve all images of a specific folder

when i run the form, and check the properties of the image i get the correct url , but the image name is like this /pix/adds/laylet%203umr/%7b0%7d

with the image name %7b0%7d

where laylet 3umr is the name of the folder specified by user click comming from a previous page, but the image name that i can`t specify due to existance of many images in the same folder that i want to display all images of this folder
NB: this page is just an adapter to recieve query strings from the previous page
the code i am using is the following
<asp:DataList ID="dtlImg1" runat="server" Height="611px" Width="890px" DataSourceID="SqlDataSource1">  
<ItemTemplate>  
<asp:Image ID="imgThumb1" runat="server" Width="500" ImageUrl='<%#"\pix\adds\" &Eval("title")&"\{0}"%>' EnableViewState="true"  /> 
<asp:Label ID="lblFileName" runat="server" Text=''/>  
</ItemTemplate>  
</asp:DataList> 


Is This A Good Question/Topic? 0
  • +

Replies To: problem in displaying all images contained in a folder

#2 marinus   User is offline

  • D.I.C Addict
  • member icon

Reputation: 138
  • View blog
  • Posts: 575
  • Joined: 14-April 10

Re: problem in displaying all images contained in a folder

Posted 22 April 2011 - 01:38 PM

You will be better of writing this in C# code than trying to embed code in asp.net , like they do in php or classic asp.

To be honest it doesn't look good at all in asp.net , as classic asp,or php is intended to be a scripting language .

Asp.net is not , and is not a programming language. and there for will not do the following

Quote

retrieve all images of a specific folder


<%#"\pix\adds\" &Eval("title")&"\{0}"%>' EnableViewState="true"  /> 



This above code would probably need and end extension like jpg, gif. Or you path is incorrect ,

Greetings

Marinus
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1