So what do you need to make it work in each and every web browser. You need to add the width and height attributes to the
Example:
if you have such asp.net code
" asp:imagebutton id="ImageButton1" runat="server" width="50px" height="20px" "
the HTML code generated by it is:
{ input type="image" name="ImageButton1" id="ImageButton1" alt="" border="0" style="height:20px;width:50px;" }
it works fine with IE but not with any other browser
so what needed to be changes, we need to add this
" asp:imagebutton id="ImageButton1" runat="server" "
ImageButton1.Attributes.Add("width","50");
ImageButton1.Attributes.Add("height","20");
now the HTML genertaed will be:
{ input type="image" name="ImageButton1" id="ImageButton1" alt="" border="0" height:20px width:50px }
Enjoy..
No comments:
Post a Comment