2

If I have the following :-

<asp:image height="54" width="54" runat="server" id="imgA" imageurl="/pic.jpg" />

when it get compiled, it comes out as :-

<img src="/pic.jpg" style="height:54;width=50;" id="imgA"/>

Whenever I put it through Google tools, it says to improve the page, I need to put the size which it expects it in the non-style format. Is there anyway to force the .NET compiler to compile to the non-style format so the result is :-

<img src="/pic.jpg" height="54" width="50" id="imgA"/>

or is the only way is to use img rather than asp:image ?

0

2 Answers 2

1

Try like this

CSS

.img{
  height : 54px;
  width : 50px;
}

.aspx

<asp:image CssClass="img" runat="server" id="imgA" imageurl="/pic.jpg" />
Sign up to request clarification or add additional context in comments.

1 Comment

Nope, Google Page Inside says "The following image(s) are missing width and/or height attributes." I used the method above with CssClass but it doesn't seem to accept it in CSS form, it has to be the old format. The resulting html has to be in the format as per third example in the question.
0

If you think that your image would be at a certain size, then you need to resize your image to that size... I can't imagine that you load a file from 10MB to fit in a canvas of 50x50 px :=)

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.