.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Image inside a

shows extra lines around the image Posted By:      Posted Date: September 30, 2010    Points: 0   Category :ASP.Net 

I am working with two different 'rounded corner' images and I am getting an extra line at the top of the smaller image.  The first image, headerborder_corner_tl_3.png, is 25 x 25.  This image diplays correctly in the first <div> below. 

The second image, pageborder_corner_tl_4.png, is 15 x 15.  In the second <div> below, the image gets displayed with an extra line at the top of the image.  But if I comment out the second <td>  (as I do in the third <div>) the image displays correctly.

Looking at the second div, can someone shed some light on what might be causing the image to be displayed with an extra line above it...or why it displays correctly when I comment out the second <td>?

        <table bgcolor="#F6AD2C" cellpadding="0" cellspacing="0" align="center">
                <td width="25" height="25">
                    <img src="<%= Page.ResolveUrl("~&q

View Complete Post

More Related Resource Links

image inside custom server control



I want to use an image inside a Custom Web server control ! 

Do I need to use Web.resources ? if so , how to do ?

Image stretch inside a grid stops working horizontally once columns are added to grid.

I have a simple setup of a window. Window contains a grid, inside the grid there is an image. I want the image to always stretch across the entire cell. I've set it's Stretch property to Fill and it works fine, as long there is only one column in the parent grid. As the window is resized, the image stretches correctly. As soon as I add another column, the image stops stretching horizontally. Vertially it works just like before, horizontally it now appears with a fixed width corresponding to the width of the picture used as the source. Does not matter which column it's positioned in, and I've tried encapsulating it into another grid but behaviour does not change. It behaves the same in both Visual studio 2010 designer and at runtime. In addition when I tried to encapsulate it in a second grid, this seond grid also now has altered behavior - instead of sizing itself to it's container (both height and width are not set) as it's parent grid does, it now sizes itself to its contents - the image. But only horizontally. What is going wrong here, is this a bug or am I missing something, and any advice on how I can get the image to fill one of the cells of a grid with more then one column?

Alert not working when used with image inside gridview

I am currently using following code to set alert on required column of my grid. When I change button type to Image the alert appear after completion action. Any quick suggestion??   My code is below.. protected void grdDelTempList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[6].Attributes.Add("onClick", "javascript:return confirm('Are You Sure?');"); } }    

imagebutton shows "submit query" before image display


hi guys,

i have imagebutton's on a page with width/height's set and the imageurl pulls from a database

anyway theres 20'ish images on the same page so it takes a second or 2 for the images to load, unfortunately with the imagebutton, while it's in that limbo stage there's 20 big ugly grey SUBMIT QUERY textboxes in my face.


anyone know how to wkraround this? some sort of default already loaded image, or somehow to turn that off altogether? 

Problem with Editing image inside DetailsView inside UpdatePanel



I have a problem and I really hope you'll be able to help me.

I'm trying to add and edit an image which is located in a detailsview which is inside an UpdatePanel. After I read relevant topics in the forum I installed the Ajax Control Toolkit. Below is my source code. When I used it only for insert new image it worked great. The problem caused when I tried to implement it on the Edit mode, i.e. when I tried to edit the image and upload a different image.  Unfortunately it didn't work as I hoped. Nothing happend and the image hasn't been changed. I also tried to change the IDs (AsyncFileUpload ID) to be the same in both places but it didn't work either.

The source code:

<asp:DetailsView ID="dvMovie" runat="server" Height="50px" Width="695px"
                    AutoGenerateRows="False" DataSourceID="sdsMovieById"      
                     BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"

Image tag rendering inside repeator


i have a repeator control that is bind to a dataset, one of the field is image path that is bind with <img src tag. Now the problem is so of the articles are with out any image, how can i make sure that <img tag only render when there is an image name exist?

   <asp:Repeater runat="server" ID="rptCollections">
                <br />
                        <img style="margin-right: 10PX; width: 200PX; float: left;" src="<%#Eval("MainImage ").ToString()%>" /><%#Eval("Summary").ToString()%></p>--%>
        <asp:Repeater runat="server" ID="rptContent">
                <table border="0" cellpadding="0">

ASP Image inside UpdatePanel changing ImageUrl



I have a WebForm which has an update panel. Inside the panel I have an ASP Image. I have also, 2 ImageButtons which act as the triggers for the UpdatePanel.

<asp:UpdatePanel ID="updImage" runat="server">
          <asp:AsyncPostBackTrigger ControlID="btnBackward" EventName="Click" />
          <asp:AsyncPostBackTrigger ControlID="btnForward" EventName="Click" />
          <asp:Image ID="Image1" runat="server" Width="75px" Height="75px" BorderStyle="Solid" BorderWidth="5px" BorderColor="White" />

In my WebForm, I also have an ASP Image component outside the Update panel.

The ImageUrl of those ASP Image components are loaded from a folder that is outside the WebSite root folder, using the code found in this link:


handle image inside div tag


is there any way to fit the image size @ div size.

i mean my image is little bigger or little lower in size than div size or assume i have a div which has not hight and width attribute then how do i handle image inside div. i think it is not possible to handle when div has no h&w attributes and in this case image will come with its own h&w.

but if have defined the h&w for any div tag then there should be some way to manage little size differences.

or reply me if you have a good way to manage size consistency.


When binding value to ImageUrl property of Image using XPath it shows code as html markup on fronten


I have a listview in which I want to show an image from an xmldatasource control.

The following works, and shows the value of thumb (in this case: 12_634232073402187500_whatever.jpg)

<asp:ListView ID="repLocationsToCompare" ItemPlaceholderID="itemsGoHere" runat="server">
            <%# XPath("thumb")%>
<asp:XmlDataSource EnableCaching="false" XPath="root/data/compare/locations/location" ID="XMLDSCompare" runat="server"></asp:XmlDataSource>

No problem there, BUT, when I use an imagecontrol:

<asp:ListView ID="repLocationsToCompare" ItemPlaceholderID="itemsGoHere" runat="server">
            <asp:Image ID="img" Visible='<%# XPath("thumb

Radio buttons, a label and an image button show twice inside update panel


I have an update panel with a set of 2 radio buttons, a label and an image button inside of it. There another set of 3 radio buttons that trigger the update panel. I got everything working but now the image button, label and set of 2 radio buttons inside the update panel show up twice when the radio button triggers are selected? Any ideas?

Image Inside a webpart


Hi All Gurus

I am trying to create a webpart in which I have 15-20 images & I want the images to change as per the month & season. the images are static they will never change.

Can someone pls suggest me the best way to achive this. I am looking for a solution from scratch.

My Approach (I am thinking but open to your inputs) is;

1) Create a User ctrl & place a Image control on it.
Here what will be my URL to make the webpart look at ~layout/image/New Foldername/Image.Imageextn (If some one can give me a code snippet of this will be a great help. I will surely vote :)

But with the above appraoch I am thinking where to store my images physically other than Layouts, also this will be deployed to multi WFEs

Also, if I want to use the layouts folder, what will be my DDF file command to create the folder in ~layout/image/New Foldername/Image.Imageextn

Thanks in advance Vote assured
Happy Sharepointing.

I am a learner So your help will help me build


Happy Sharepointing... Regards SPTECH07

Built-in Functions - Text and Image Functions in SQL Server

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Future versions of SQL Server will not support TEXT, NTEXT and IMAGE data types. Columns with TEXT / NTEXT data type do not support commonly used string functions such as LEN, LEFT, RIGHT, etc. Furthermore, due to the large size of TEXT data you''re likely to see performance issues if you store such data in the database. However, at times you can''t help but use the TEXT / NTEXT / IMAGE data types (for example when supporting 3rd party databases when you cannot change the schema) - this is when text and image functions come in handy.

Program for Format Conversion of An Image

.NET provides extensive support for image conversion. Any image can be processed from one format to another. Most common formats to which .NET have support for are .BMP, .EMF, .GIF, .ICO, .JPG, .PNG, .TIF and .WMF.

Configuring Profile Image Export in SharePoint 2010

It's no secret that I am thrilled with the new social features of SharePoint 2010. I am most excited about the new Profile Picture handling. I strongly believe that the more we can show the faces of our colleagues to one another the more connected we will feel. Clearly Microsoft feels that way as witnessed by the many features that make use of the Profile Image like the Activity Feed and Colleagues list

Built-in Functions - Text and Image Functions

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

ASP.Net Upload Image to MS Access Database

As you learnt from the previous articles to upload image to the SQL Database in ASP.Net 2.0 and stream that image into the memory to retrieve it from the database and display it on the web page. In this article you will learn how to upload images to the MS Access database in ASP.Net 2.0

First of all create an Access Database and place it in the App_Data folder of ASP.Net web site project. Then create a table "tblImg" with the following fields:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend