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

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

Have you noticed certain PNG images fail to load?

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net
Using the code such as found below, sometimes certain .PNG files will fail to load. While other images, nearly identical in size, never have any such problem. Build Action set to Resource. Why is that? Anybody figure it out? This is for a datagrid but I doubt the control has much to do with it. Probably certain .png files make Visual Studio 2008 choke because of some attribute set internally. But it's a mystery to me....anybody else notice this? # private void dGrid_LoadingRow(object sender, DataGridRowEventArgs e) { Employee emp = e.Row.DataContext as Employee; FrameworkElement ele = dGrid.Columns[4].GetCellContent(e.Row); string url = "http://localhost:7642/DisplayImageHandler.ashx?id=" + emp.ID; Uri imageUri = new Uri(url, UriKind.RelativeOrAbsolute); (ele as Image).Source = new BitmapImage(imageUri); } private void img1_ImageFailed(object sender, ExceptionRoutedEventArgs e) { Image img = sender as Image; // Display an image for error here }

View Complete Post

More Related Resource Links

VS 2010 XAML Design View Load always fail with a Type Load Exception

Create a new WPF project in VS and change nothing. The Design View will fail to load with the error below. Error    1    Could not load type 'Microsoft.Expression.DesignModel.Core.ISharedInstanceBuilder' from assembly 'Microsoft.Expression.DesignModel, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Microsoft.Expression.DesignModel is an assembly from Expression Blend. I ever installed Blend 4 RC and uninstall and install Blend 4. I Reflector the assembly I have under Blend 4 bin folder. And cannot find a interface named ISharedInstanceBuilder. But the WPF project is a Template project without any changes. How it get related with Blend 4? And how to fix it? Thanks.  

How to only render/load images only when needed

Any tips on where to start looking/investigate Re how to code pages to only load/render images when that part of the page is visible ?e.g. Recent Google Image Search and Facebook interfaces.Up to now my Ajax experience has been limited to extensions + Toolkit so not sure where to start looking.TIA

Unable to load current sub site's images from Sitecollectionimages folder


I am Unable to load current sub site's images from Sitecollectionimages folder

I have used the same master page all through the site for testing, I have used


I have resources Site, it works fine, Now I create a HR site under resources and Benefits sites under HR Site, I apply the same master page, my banner and footer images is not rendering, can someone please provide me a hint on how to point to the sitecollectionimages folder, is ../../ rightway to point to the folder or can i register a root and use that the pointing to the right folder.

I have a publishing site, It is on an vm, I am the admin for the site

Thank you


How to load Images with "component" URI using XamlObjectWriter / XamlXmlReader


Hi, using XamlXmlReader/ XamlObjectWriter I have problems to read Image Elements with Source property set to a "component" URI like this.

<Image Margin="329,30,55,260" Source="/WpfControlLibrary1;component/ControlLibImages/Image1.JPG" /> 

With turned on "Thrown" Common Language Runtime Exceptions my debugger stops at "xamlWriter.WriteNode(xamlReader);" widh a "Could not find a part of the path 'C:\WpfControlLibrary1;component/ControlLibImages/Image1.JPG" Exception. (Look at the C:\ at the beginning!). The Exception is handled by MS so I can not use Try/Catch around the .WriteNod

why is that when i insert images tooltips take longer to load, also, Pop-up time-outs, can this be c


Why is that when i insert images the pop-ups take longer to load!?

I'm using an image that show's a question mark for tooltips (only 7Kb in size), the idea is you hover above the image and a tooltip appears giving information regarding the adjacent question (i'm developing an accident tracking system, so some questions relate to working lost days and i want to give users an explanation as to why i'm asking for certain information)

As i say, with each image i add the tool tips seem to take longer to appear?!

Also, is there a way of adjusting how long the tool tips appear for?

cannot load images from localhost under II7



on my dev machine (windows 7 with II7) I run a asp.net 4 web site. The web site run under the Visual Studio ASP.NET development server. 

The problem is that I have a page that should load images from an external server. To test this behaviour I have created a virtual directory under IIS and I try to connect to the image with the following link:


I tested the link from a browser and It worked well, but I'm not able to load the image from my asp.net application. The page begin to load for a very long time and finally shows the classic red cross. if I right click and select show image the image display well.

any help would be appreciated.

load images with http request


Hi i have a usercontrol which displays 1 inage this control is used several times on my page. the problem i have some images can be large so i need to load them using http request i think, i want to display a loading image until the actual image is loaded, what would be the best way to do this?

Combine, minify and compress JavaScript files to load ASP.NET pages faster

Websites are getting more interactive these days and most of this interactivity comes from JavaScript. People are using different JavaScript libraries and frameworks to make their websites more interactive and user friendly.

Images in WPF

How to create a Thumbnail of an Image. How to automatically crop an image. The following method allows you to automatically crop an image to it's content.

Reading and Writing Images From a Windows Mobile Database using UltraLite 10(C#)

Periodically I get a request for information on how to read and write binary data to a database running on Windows Mobile. If you search the Internet you can typically find examples that are available on Windows Desktops or allow you to read and write to a local file system. The problem is that it can take a bit of work to get this code to work on Windows Mobile accessing a database.

Ultimately you might be asking, why would I want to store and image in a database? Well in an environment where you synchronizing data between a local mobile database and a consolidated (central) database this can be extremely useful. Imagine if an insurance adjuster went to an accident scene, took a picture of a damaged car, loaded it into his Windows Mobile database and then replicated that image up to the Insurance headquarters for approval. All of this could be done in a very short period of time when using images in the database. Another good example might be a doctor who was waiting for a patient chart to become available. If you could store the image in a database this chart could be sent down to the doctor's device once it became available.

For this article I am not going to get into how to synchronize the images to and from a remote and central database as this is typically fairly straightforward when using a data synchronization technologies like MobiLink

Save images to SQL CE

Storing binary objects (such as image, office document etc.) into database is a little cumbersome when it comes to retrieval. Hence the most commonly accepted way is only store the file path in the database, and to store the documents on a file share.

DataTable - Load from IDataReader - CreateDataReader - ReadXml WriteXml - Free ADO.NET Tutorials

The DataTable in ADO.NET 2.0 has been seriously beefed up and I absolutely love it. Not everything we consume deals with multiple resultsets and requires the ever popular DataSet. With the cool new features in the ADO.NET 2.0 DataTable, we can get many of the cool features in the DataSet without all the extra baggage and memory footprint particular to multiple resultsets.

Load DataTable from IDataReader

Store and Display Images from MS Access Database Using C#

There is only the difference of coding syntax to stream the binary data of image content type to upload it into MS Access Database using C#/VB in ASP.Net 2.0

Namespaces required:-
using System.Data.OleDb;

OleDb is used to connect the web site forms with MS Access Database using Microsoft.Jet.OLEDB.4.0

ActiveSync 4.5 (Free Down Load) using in Windows Mobile Pocket Pc

Microsoft ActiveSync 4.5 is the latest sync software release for Windows Mobile-powered devices. ActiveSync provides a great synchronization experience with Windows®-powered PCs and Microsoft Outlook right out of the box.


* Faster file transfer speed and photo sync via Outlook are only available for Windows Mobile 5.0 powered devices.
* Remote PC Sync (via WiFi or LAN) has been removed due to Enterprise customer feedback around security issues.
* Customers using Microsoft Exchange 2003 Service Pack 2 with devices running the Messaging and Security Feature Pack for Windows Mobile 5.0 will benefit from the following feature enhancements included in ActiveSync 4.5: Direct Push Technology, local device wipe, and certificate powered authentication to Microsoft Exchange.
* Microsoft® Outlook® 2000 is not supported by ActiveSync 4.5. It is highly recommended that users upgrade to Microsoft® Outlook® 2003 messaging and collaboration client.
* Conversion of database files for use on a mobile device is not supported by ActiveSync 4.5. On previous versions, this feature was limited to devices running Windows Mobile software for Pocket PC 2003 and earlier.
* Conversion of font files for use on a mobile device is not supported by ActiveSync 4.5. On previous versions, this feature was limited to devices running Windows Mobile software for Pocket P

Open File Print File Excel

Batch print many Excel files without having to open each one at a time. Quickly print mass amounts of xls files at once with this program. You must have Excel installed on your machine..

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or pasting into an application. 2D versions are also available:

website load testing


How can i check "load testing" on my site (its using vb.net and SQL server)? Any free tool available or can it be done through windows server IIS?

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