Results 1 to 3 of 3

Thread: How to use Gridview ImageField in DataImageUrlFormatString on ASP.net

  1. #1
    Join Date
    Apr 2009
    Posts
    91

    How to use Gridview ImageField in DataImageUrlFormatString on ASP.net

    There are some small gridview which includes an ImageField on my pc. Now i would like to use that particular image in my web.config file. It should used in DataImageUrlFormatString, but i don't know that how to figure it out. Can any body tell me that how can i do it? Does any body knows about it? Kindly provide me the correct logical solution for the above issue.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How to use Gridview ImageField in DataImageUrlFormatString on ASP.net

    You can try out the following code for the above issue.

    <asp:Image runat="server" ImageUrl='<%# getImagePath(Eval("ClaimID").ToString(), Eval("ImageID").ToString()) %>' Width ="125px" Height="125px"/>
    along with this code:-

    public string getImagePath(string claimID, string imageID)
    {
    string path = "/Alpha_Site/Images/" + claimID + "/" + imageID + ".jpg";
    return path;
    }
    Hope so it may help you out.

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: How to use Gridview ImageField in DataImageUrlFormatString on ASP.net

    Hey if you want, you can try out the following code:-

    <asp:Image ID="Image1" runat="server" ImageUrl='<%# String.Format("{0}/{1}", HttpUtility.UrlDecode(Eval("dirname").ToString())), HttpUtility.UrlDecode(Eval("filename").ToString()))%>' />

Similar Threads

  1. Export Gridview to Excel in VB.Net
    By Ariadne in forum Software Development
    Replies: 4
    Last Post: 15-06-2010, 06:30 PM
  2. Datagrid VS Gridview
    By Techno Guru in forum Software Development
    Replies: 5
    Last Post: 16-01-2010, 12:42 PM
  3. Nested DataTable for GridView
    By Renderman21 in forum Software Development
    Replies: 3
    Last Post: 08-05-2009, 02:08 PM
  4. asp.net gridview to pdf
    By Dietrich in forum Software Development
    Replies: 1
    Last Post: 05-02-2009, 12:15 PM
  5. Getting data from a selected row in gridview in VB.Net
    By Booth in forum Software Development
    Replies: 2
    Last Post: 15-01-2009, 10:39 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,155,734.12749 seconds with 17 queries