.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

images problem

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :ASP.Net

Hi all,

         I am developing Intranet web site. The site is having master page where I put header image. But when I access the page from other computer (Client machine) the images are not displaying. It displays on server side machine.

can anyone tell me about is this?

View Complete Post

More Related Resource Links

XPS Export with images problem.

Hi, I have a drawing pad which is a Canvas which shapes can be added to in the form of Windows.Shapes.Shape.  These get drawn by overriding the DefiningGeometry property and setting the shapes values there. For images this looks like this Public Overrides Function Draw() As Geometry If Me.Pen.Thickness = 0 Then Return Nothing Dim rf As Rect = ReturnFixedRectangle() Me.Fill = Me.ImageBrush Dim mt As New MatrixTransform(Me.Matrix) m_rectangle.Rect = rf Me.VisualTransform = mt Return m_rectangle End Function Where Me.ImageBrush is Public Property ImageBrush() As ImageBrush Get If m_imageBrush Is Nothing Then m_bitmapStream = New System.IO.MemoryStream m_bitmapStream.Write(Me.ImageBytes, 0, Me.ImageBytes.Length) m_bitmapStream.Seek(0, IO.SeekOrigin.Begin) m_frame = System.Windows.Media.Imaging.BitmapFrame.Create(m_bitmapStream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad) m_aspectRatio = m_frame.Width / m_frame.Height m_imageBrush = New ImageBrush(m_frame) m_imageBrush.Stretch = Windows.Media.Stretch.Fill m_imageBrush.TileMode = TileMode.None m_imageBrush.Freeze() m_bitmapStream.Close() End If Return m_imageBrush End Get Set(ByVal value As ImageBrush) m_imageBrush =

problem with css and images in view

Hi, I use mvc2 for creating a web site, and I use a css and images in my Master page. When I create a "List" view with this master page my css works fine and my images is right there, but when I create a "Create" view there is none of images that I use them in Master page; and when I create "Edit" view not only there is no picture but also it's hard to say page have a css.  

C#: Problem loading images in html



I understand that PHP has a function file_get_contents that is able to load html content and output out.

I am trying to simulate the similar behaviour in .NET. I used:

System.Net.WebClient oClient = new System.Net.WebClient();
return oClient.DownloadString(fileName);

However, I have a problem displaying the image in html. When PHP file_get_contents is used, it will display the html with the images too. However, when used the above .net method, it does not display the image when render the html.

The image in the html tag is <img src="images/test.png" />

May I know is there anyway to simulate like PHP file_get_contents and show the html with the images too?


Problem with resizing images and padding them to squared images before binding them to grid



I am developing a web application in ASP.NET and C# using Visual Studio 2008. The application will among other thing store images into a database in the original format and in some resized formats. I have this method that takes an image as argument and returns an image with the specified size:

thumbnailmage = ResizeImage(originalImage, new Size(50,50));

The image returned is proportional to the original image with no side bigger than 50 pixels. E.g. if the originalImage has width 100 and height 200 the resized image has width 25 and height 50. This result is expected and wanted.

Now, to what I really want. I want to modify the ResizeImage method to return a squared thumbnail. I.e. in the originalImage example sizes above, the returned image should have width width and heigth both 50. Also, the image should not be stretched but padded with 12.5 pixels on the left and right side making the width 50. The image format I currently work with is gif with transparent background so the padded image parts should also be tansparent. Here is the code for ResizeImage, does anyone know how it could be modified?

  private static Image ResizeImage(Image imageToResize, Size size)
      int sourceWidth = imageToResize.Width;
      int sourceHeight = imageToResize.Height;


Making images available to NON-WPF applications (drag/drop) problem


Hallo: I am experimenting with drag and drop features, and in particular, with dragging images from my applications. The images are stored as BitmapImages and, when I start the drag event, I would like to fill the DataObject also with data which can be pasted also by other applications (such as, i.e. MS Word).

So, my code, for the time being, is:

BitmapeImage img;
///... some bitmapImage Initialization code...

/// Code Handling Drag event
DataObject myData = newDataObject();

myData.SetData(typeof(BitmapImage), img);

System.Drawing.Bitmap bmp = BitmapImageToBitmap(img);
myData.SetData(DataFormats.Bitmap, bmp);
myData.SetData(DataFormats.StringFormat, "Some String");

Where BitmapImageToBitmap is:

using Bitmap = System.Drawing.Bitmap;
using BitmapImage = System.Windows.Media.Imaging.BitmapImage;
using Encoder = System.Windows.Media.Imaging.BmpBitmapEncoder;


Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

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.

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

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:

Virtual Path Problem


 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-


Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"

        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http

Strange Photo upload problem


I'm working project it's live on shared hosting

we'er uploading photos to a file on the server everything works fine the photo is resized renamed and sent to the folder

the upload page returns the thumbnail and the full size photo it's there all the photos have to be approved by an admin

twice now after they have been approved they disapear I checked the folder they are not there could there be anywhere

on the server they could get hung up before they go into the folder I have it setup so when you delete the data base entry it deletes the photo from the folder othe than that you need to open the folder and delete the photo this has hapened twice now I tried to recreate it with no luck

thaks for your help in advance

ASP.Net Caching problem ??


I'm having a problem with an asp.net 3.0 application using a gridview to display data.  The problem seems to be that despite a brand new .selectCommand being sent to the sqlDataSource, the gridview starts displaying data from *someone else's* query.  For example, user A is logged in and will be working fine until a few page submissions later when the gridview data starts suddenly showing information that belongs to another user. 

This is my first asp.net application, though I've been working with classic asp and ADO for years so I'm used to sending a SQL string and getting back the results from that string.  Apparently there is a complex caching system which is interferring which I do not at all understand so at this point I just want to stop the server from caching any data whatsoever.  Is this possible?

Any and all help will be much appreciated!!

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