gridview ImageField path

Hi experts,

I have a gridview question.

In my gridview i have one image field that looks like this:

            <asp:ImageField DataImageUrlField="IMAGE_PATH"
                DataImageUrlFormatString="images/{0}" HeaderText="document image">

In my Sql server in table1 I chave a column called IMAGE_PATH
and the value in the column looks like this:   picture1.jpg

So in my project, i have  a folder called images and that is where my few images are physically located.

So the above code shows my images in the gridview just fine.

My question is this:

What if instead I stored my images instead at some location on my c drive such as  C:\asp\images  instead of in a folder in my project.

So, In my Sql server in table1 I would have a column called IMAGE_PATH
and the values in the column would look like this:  


How would i write that in imy ImageField tag?  Can anyone help
I tried the following, but that didn't seem to work

            <asp:ImageField DataImageUrlField="IMAGE_PATH"
                DataImageUrlFormatString="C:\asp\images/{0}" HeaderText="document image">

Can anyone help?

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Shaun KlineConnect With a Mentor Lead Software EngineerCommented:
Unless the c:\asp\images folder is a virtual directory for your project site, you will not be able to reference files in that manner. Your images folder must be a relative or absolute path for your web server.
All Courses

From novice to tech pro — start learning today.