trouble with Image

I'm attempting to select an image path from a database and  load it into an asp Image, but the image doesn't show.
<asp:FormView ID="FormView1" runat="server"  DataSourceID="SqlDataSource1" Width="100%" >
            <table style="width: 100%">
                        <asp:Image ID="Image1" runat="server" Width="1000px" ImageUrl='FieldPics/<%# Eval("relPath") %>' />
                        <%--<img src='FieldPics/<%# Eval("relPath") %>' width="1000px" id="Image1" alt="myPic" />--%>
                        <asp:Label ID="Label1" runat="server" Font-Bold="True" Text='<%# Eval("photoBy") %>' Font-Names="Verdana" Font-Size="12px"></asp:Label>
                        <asp:Button ID="btnRotLeft" runat="server" Text="Rotate Left" />
                        <asp:Button ID="btnRotRight" runat="server" Text="Rotate Right" OnClick="btnRotRight_Click" />

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT replace(relPath,'\', '/') as relPath, picDateTime, county, quad, photoBy, photoDesc, fTrackID FROM fieldPics WHERE id = @PhotoID">
            <asp:QueryStringParameter Name="PhotoID" QueryStringField="photoid" Type="Int32" />

Open in new window

If I do this with an html image, it will show...
<img src='FieldPics/<%# Eval("relPath") %>' width="1000px" id="Image1" alt="myPic" />

Open in new window

But I'm trying to rotate the image with ImageMagick and then I can't do this....
protected void btnRotRight_Click(object sender, EventArgs e)
        Image img = (Image)FormView1.FindControl("Image1");
        string imgSrc = img.ImageUrl;
        ClientScript.RegisterStartupScript(this.GetType(), "error", string.Format("alert('{0}');", imgSrc), true);
        string arg = @"convert """ + Server.MapPath(imgSrc) + @""" -rotate 90 """ + Server.MapPath(imgSrc) + @"""";
        displayImg(imgSrc, 5000);

Open in new window

I also can't get a proper ImageUrl into my ImageMagick command.  It tells me I have illegal characters.  When I use window.alert to display the ImageUrl it shows 'FieldPics/<%# Eval("relPath") %>' rather than 'FieldPics/CONWAY/ATKINS/DSCN0220.JPG'
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nate_LRAuthor Commented:
I figured out that I needed to do this...
<asp:Image ID="Image1" runat="server" Width="1000px" ImageUrl='<%# Bind("relPath", "FieldPics/{0}") %>' />

Open in new window

instead of this...
<asp:Image ID="Image1" runat="server" Width="1000px" ImageUrl='FieldPics/<%# Eval("relPath") %>' />

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.