Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-06-2009
Member
 
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.
Reply With Quote
  #2  
Old 08-06-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: How to use Gridview ImageField in DataImageUrlFormatString on ASP.net

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

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

Quote:
public string getImagePath(string claimID, string imageID)
{
string path = "/Alpha_Site/Images/" + claimID + "/" + imageID + ".jpg";
return path;
}
Hope so it may help you out.
Reply With Quote
  #3  
Old 08-06-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: How to use Gridview ImageField in DataImageUrlFormatString on ASP.net

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

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

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to use Gridview ImageField in DataImageUrlFormatString on ASP.net"
Thread Thread Starter Forum Replies Last Post
Export Gridview to Excel in VB.Net Ariadne Software Development 4 15-06-2010 06:30 PM
Datagrid VS Gridview Techno Guru Software Development 5 16-01-2010 12:42 PM
Nested DataTable for GridView Renderman21 Software Development 3 08-05-2009 02:08 PM
asp.net gridview to pdf Dietrich Software Development 1 05-02-2009 12:15 PM
Getting data from a selected row in gridview in VB.Net Booth Software Development 2 15-01-2009 10:39 PM


All times are GMT +5.5. The time now is 02:44 PM.