TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
selva kumar
NA
557
189.9k
How to display image name without extension using data list?
Dec 4 2013 3:14 AM
Hi friends here i m using datalist control to display images from folder with name.its working fine but the images name displayed with extension( like .jpg,.png).I want to display only image name without their extension can any one help me out...
here is my code.....
<asp:DataList ID="DataList1" runat="server" RepeatColumns="5" CellPadding="5">
<ItemTemplate>
<asp:Image ID="lblimg" runat="server" Height="180px" Width="130px" ImageUrl='<%# Bind("Name","~/Books/{0}") %>' /><br />
<asp:label ID="lbltitle" runat="server" Visible="true" Text='<%# Bind("Name") %>'>
</asp:label>
</ItemTemplate>
<ItemStyle BorderColor="#660000" BorderWidth="1px" HorizontalAlign="Center"
VerticalAlign="Bottom" />
</asp:DataList></td>
C#:
DirectoryInfo dir = new DirectoryInfo(MapPath("Movies"));
FileInfo[] files = dir.GetFiles();
ArrayList listItems = new ArrayList();
foreach (FileInfo info in files)
{
listItems.Add(info);
}
DataList2.DataSource = listItems;
DataList2.DataBind();
Reply
Answers (
3
)
how to deploy asp net mvc application
how to get mac address of client