Advertisement

09.29.2008 at 11:06AM PDT, ID: 23772312 | Points: 500
[x]
Attachment Details

How to set an image control width / height from an eval statement

Asked by d-maxxx in VB Script, Web Images

Tags:

Im having a problem forming the correct EVAL statement to change the Height / Width of an image button
from the stored info in a database.
Values in the database are in string format "120px" etc.

        <asp:ImageButton ID="ImageButton1" runat="server" Width='<%# Eval("width") %>'
                             Height='<%# Eval("height") %>' ImageUrl='<%# Eval("Image_Name") %>'

keep getting this error:
Exception Details: System.InvalidCastException: Specified cast is not valid.
Start Free Trial
[+][-]09.30.2008 at 12:58AM PDT, ID: 22603403

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.30.2008 at 09:38AM PDT, ID: 22607096

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.30.2008 at 10:04PM PDT, ID: 22611726

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628