Dynamically set the size of thumbnails in a gridview

Posted on 2008-11-18
Last Modified: 2013-11-07
I am using a gridview to display images.

I would like to set the image sizes to the value stored in profile_thumbX and profile_thumbY however I'm struggling to find a solution.


Using VB ASP.Net V2.0 SP1
<asp:ImageField DataImageUrlField="fileLoc" DataImageUrlFormatString="./streamFiles/streamJPEG.aspx?reqFLc={0}" HeaderText="ThumbNail" ShowHeader="false">


Open in new window

Question by:JamesAStewart
    LVL 8

    Expert Comment

    by:Haris V
    please check this link,

    Accepted Solution

    I have chosen to use the following code:
        <asp:Image ID="thumbNail" ImageUrl='<%# eval("fileLoc","./streamFiles/streamJPEG.aspx?reqFLc={0}") %>' runat="server" Width="<%# Profile.osc_thumbX.ToString %>" Height="<%# Profile.osc_thumbY.ToString %>" />

    Open in new window


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now