473,396 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Why the height width for image cant be limited with styles in Datalist Template?

I applied the header template in datalist control and limit the height and width of area as 100 and 100 but the image displayed is on full page but later i apply the limits to an image it displays but the there is some margins left shown why so?

Here is code:
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Scraps_page.aspx.cs" Inherits="Scraps_page" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7.     <title>Untitled Page</title>
  8. </head>
  9. <body>
  10.     <form id="form1" runat="server">
  11.     <div>
  12.  
  13.     <table>
  14.     <tr>
  15.     <td>
  16.         <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" 
  17.             AutoGenerateRows="False" DataSourceID="SqlDataSource1">
  18.  
  19.         <HeaderStyle BackColor="Bisque" Height="100" Width="100" />
  20.         <HeaderTemplate>
  21.         <asp:Image ID="Image1" Height="100" Width="100" runat="server" ImageUrl='<%#Eval("ImageUrl") %>' AlternateText='<%#Eval("ImageUrl") %>' />
  22.         </HeaderTemplate>
  23.         <FooterTemplate>
  24.          <asp:Literal ID="Literal1" runat="server" Text='<%#Eval("Name") %>'></asp:Literal>
  25.         </FooterTemplate>
  26.         </asp:DetailsView>
  27.  
  28.  
  29.  
  30.         <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
  31.             ConnectionString="<%$ ConnectionStrings:ex %>" 
  32.             SelectCommand="SELECT * FROM [tblImage] WHERE ([id] = @id)">
  33.             <SelectParameters>
  34.                 <asp:QueryStringParameter Name="id" QueryStringField="id" Type="Decimal" />
  35.             </SelectParameters>
  36.         </asp:SqlDataSource>
  37.  
  38.  
  39.  
  40.  
  41.     </td>
  42.     <td>
  43.  
  44.     </td>
  45.     </tr>
  46.     </table>
  47.     </div>
  48.     </form>
  49. </body>
  50. </html>
  51.  
  52.  
Feb 15 '11 #1
0 1044

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Ana | last post by:
I just ran a report on a site I'm redesigning and came up with all these missing height/width tags. How important are they? Should I go through the trouble of making sure they're there? Ana
5
by: Dave Hammond | last post by:
You'd think this would be a basic part of the window object (and perhaps it is and I'm just being dense), but I can't find any reference in the IE window object documentation to a property which...
5
by: Linda | last post by:
Hi, I'm trying to get the Left/Top/Height/Width properties for some text boxes on a form to match exactly. Three of them are fine, but the fourth will not accept the changes I type into the...
1
by: Pums | last post by:
How to get the information(like height, width) of an image to be uploaded?
9
by: Adam | last post by:
Can someone please help!! I am trying to figure out what a font is? Assume I am working with a fixed font say Courier 10 point font Question 1: What does this mean 10 point font Question 2:...
2
by: Robson Carvalho Machado | last post by:
Dear friends, I'm dynamically creating a Hyperlink with spacer.gif as ImageURL that is an 1px transparent image only to determine link position, but as I create this link dynamically I could not...
1
by: | last post by:
I have a label control that I've embedded in a datalist template. I will be binding data to that label. I want to run a string formatting function on the database text before it is injected into...
0
by: mharness | last post by:
Hello All, Does anyone know how to dynamically change the width and height properties of an image in a datalist in order to maintain the original aspect ratio? I've managed to do this with a...
8
by: Kentor | last post by:
Hello, I have users that submit images to my website. By default I choose to make the width bigger than the height because usually pictures are taken horizontally... But in some cases people take...
4
by: Christopera | last post by:
Hello, I have built a site that uses two divs, one verticle, and one horizontal as graphic style for the ite. The problem I am having is that if the browser is resized very small the divs are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.