0

On my website I use imagebutton to display some images.

In my code,

<asp:ImageButton ID ="imgb" Width="125px" Height="125px"  runat ="server" ImageUrl ='<%#Eval("ustkategoriresim")%>' CommandArgument = '<%#Eval("ustkatID") %>' />

as you can see I use eval to display the image, but the image is on an upper folder. However If I do it like this ;

<asp:ImageButton ID ="imgb" Width="125px" Height="125px"  runat ="server" ImageUrl ='../<%#Eval("ustkategoriresim")%>' CommandArgument = '<%#Eval("ustkatID") %>' />

It does not work. When I use chrome's tool to check the html code I see this

src ="../<%#Eval("ustkategoriresim")%>" instead of the file path.

Can anyone point me in the right direction?

Thanks in advance.

1

1 Answer 1

1

Try this instead:

<asp:ImageButton ID ="imgb" runat ="server"
    Width="125px" Height="125px" 
    ImageUrl ='<%# "../" + Eval("ustkategoriresim").ToString() %>'
    CommandArgument = '<%#Eval("ustkatID") %>'
/>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.