"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Showing posts with label datalist. Show all posts
Showing posts with label datalist. Show all posts

Friday, February 1, 2013

addition operation in Grid inside the text box using javascript

Having addition operation on gridview in JavaScript.


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

Friday, September 16, 2011

Binding or display image having zoom effect from folder

Hi *.*,
As a continuation of my previous post. Now i'm binding images from folder.

Code 
    private class ImageFileInfo
    {
        public string FileName { get; set; }
    }

    public void limage()
    {
        string imgFolder = HttpContext.Current.Request.PhysicalApplicationPath + @"img\";
        string[] fileEntries = Directory.GetFiles(imgFolder);
        List<ImageFileInfo> mylist = new List<ImageFileInfo>();
        foreach (string fName in fileEntries)
        {
            string d = System.IO.Path.GetFileName(fName);
            mylist.Add(new ImageFileInfo { FileName = d });
        }
        dtagrid.DataSource = mylist;
        dtagrid.DataBind();
    }
 

On HTML
 
                <asp:DataList ID="dtagrid" runat="server" RepeatColumns="5" RepeatDirection="Horizontal">
                    <ItemTemplate>
                        <li><a href='img/<%# Eval("FileName") %>'>
                            <img src='img/<%# Eval("FileName") %>' alt="" /></a></li>
                    </ItemTemplate>
                </asp:DataList>

 U can download a demo from here
 Stay Tune...
Have a nice day... 'N happy Coding :)