.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

Uploaded Image is Not Display In Mozila Browser....

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


I have written code to upload image to server and save it database as below,

Dim path As String
        If FileUpload1.FileName <> "" Then
            path = Server.MapPath("product_photo" & "\" & FileUpload1.FileName)
        End If
        Dim objdatabase As New database
        Dim objdataset As New DataSet
        Dim cmd As New SqlCommand
        Dim objadapter As SqlDataAdapter

        cmd.Connection = objdatabase.con
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = "sp_in_Insert_product"
        cmd.Parameters.Add("@pr_name", SqlDbType.VarChar).Valu

View Complete Post

More Related Resource Links

Display XAML workflow image in browser and hightlight the current Activity

I have a requirement in project to display the XAML workflow in browser as image like the Visual studio designer displaying and it should Hightlight the current activity in workflow.  Please guide me on this.rajeevkalyan

Can't display an image from the database



My database has a products table that has images stored in a varbinary(MAX) column.

I'm trying to display product information in a repeater and trying to display the images as well by using a GenericHandler class but I can't get the image to show up in my page.

Here is my Handler.ashx class:

Public Class Handler
    Implements System.Web.IHttpHandler

    Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest

        '== Set up the response settings
        context.Response.ContentType = "image/gif"
        context.Response.BufferOutput = False

        Dim id As Integer = -1
        Dim stream As Stream = Nothing
        If Not String.IsNullOrEmpty(context.Request.QueryString("id")) Then
            id = context.Request.QueryString("id")
            stream = GetImage(id)
        End If

        Const buffersize As Integer = 1024 * 16
        Dim buffer(buffersize) As Byte
        'byte[] buffer = new byte[buffersize];
        Dim count As Integer = stream.Read(buffer, 0, buffersize)

        While count > 0
            context.Response.OutputStream.Write(buffer, 0, count)
            count = stream.Read(buffer, 0, buffersize)
        End While


Session problem with display of image in row of reportviewer


Hello techies...

I am new to this sql reporting service. But anyhow by surfing I am able to bind the report but i was stuck in image display.

Anyways, i also managed that. But the real problem is whenever i was keeping a image control in rdlc report i was having session prob. If i remove the image control then as usual report works fine.

Please suggest me some solution.... either for session problem or for image display. I am keeping the image name in database but for binding the rdlc report i am using a store procedure which return the path (static) concating with the image name(kept in database).

Hope to find a solution .....

Cannot Display Image in Report


 I have a report using an image control that needs to display an image inside subfolder "Images\InstitutionLogos\".

On properties of image control i have the following properties set:

MIMEType= "image/png"

Source      = Database

Value        ="\Images\InstitutionLogos\" +Fields!InstitutionID.Value+".png"

Inside subfolder "Images\InstitutionLogos\" each image is named with a number which represents Fields!InstitutionID.,(ex, 1.png, 2.png, 10.png)

However, when i run the report the image just displays an X, what am i missing?

How To display image in GridView as hyperlink


Hello Everyone 

Could someone please help me with a little issue....

I was able to save the image in the database as binary....... but now i don´t know how to display it in the GridView as a hyperlink.

I´ve read something about ImageField..... I´d appreciate any help .


Display image icon in HyperLinkField of Gridview

 Hello everyone! Can someone please tell me how to display an image in a HyperLinkField of a gridview?  Instead of words, I just want to show a simple little icon that can be clicked on and pass a query string to the next page.  The first hyperlink field I have set up works perfectly and passes the querystring to the next page.   The second hyperlinkfield is my attempt at showing the image but it's giving me a squiggly and telling me "the element img cannot be nested within the element hyperlinkfield" I got this technique from this brief article   - I would like to accomplish exactly what it says it is suppose to do. Thanks!   <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="clientID"> <Columns> <asp:BoundField DataField="clientFirstName" HeaderText="First Name" /> <asp:BoundField DataField="clientLastName" HeaderText="Last Name" /> <asp:HyperLinkField HeaderText="More Info" Text="View more info..." DataNavigateUrlFields="clientID" DataNavigateUrlFormatString="Cli

display image in gridview - unlucky with tutorials

I'm trying to display images in a gridview, but after following the examples of maybe 7 different tutorials I still haven't succeded. There are always some things that go unexplained. My latest attempt is according to this tutorial:http://www.aspdotnetcodes.com/Insert_Images_Database.aspxProblem No1: what exactly should I write in my ashx-file? Following the example in the tutorial this is the code so far:<%@ WebHandler Language="C#" Class="ImageHandler" %> using System; using System.Web; using System.Configuration; using System.Data.SqlClient; public void ProcessRequest (HttpContext context) { SqlConnection myConnection = new SqlConnection("DBPejganConnectionString1"); myConnection.Open(); string sql = "Select Image_Content, Image_Type from ImageGallery where Img_Id=@ID"; SqlCommand cmd = new SqlCommand(sql, myConnection); cmd.Parameters.Add("@ID", SqlDbType.Int).Value = context.Request.QueryString["id"]; cmd.Prepare(); SqlDataReader dr = cmd.ExecuteReader(); dr.Read(); context.Response.ContentType = dr["BildTyp"].ToString(); context.Response.BinaryWrite((byte[])dr["BildData"]); dr.Close(); myConnection.Close(); }Please give me a hint (or rather the answer) on what's missing. The rest of the problems comes later... :)

How to Display Binary Image in RDLC in asp.net?

Hi, I want to display Binary image from Database in RDLC. Can some one help me out.   Thanks in advance..  

MVVM - race condition causing image to not display

Hi, We are using MVVM pattern at work for a window that fetches data from a web service and then displays the data. The data is displayed in tabs where each tab displays a title (string) and a chart (image). There are four tabs and whatever tab that is selected to be displayed first fails to display the image. The title gets displayed and this happens asyncrhonously so you will see no title and then when NotifyPropertyChanged fires you see the title but not the image. All the tabs that are not displayed by default work as expected and show the image. And you can change which tab is not displayed and the new tab that is displayed by default will also fail to show the image. Any help greatly appreciated. Code Getting Data The code as it is shown below works. However whenever I try and use the ThreadPool to GetNineMonthsOptionData the image for that tab doesn't display. Another interesting thing is that if I use the thread pool and then put a Thread.Sleep(2000) call right after it works. So there seems to be a race condition at work here. public void LoadOption(string symbol) { _symbol = symbol; // TODO: Team A - Change to use background thread for ninemonth data also and determine // if dispatching is necessary GetNineMonthsOptionData(); //ThreadPool.QueueUserWorkItem( // (o) => // { // GetNineMonthsOptionDa

display a spinning gif when an image is fetching from server

Hi all,I would like to know how to display a loading gif picture before an image is fully loaded from server. That images are hold in a datagridview control on a master page. I searched through the web but i am really confused with what should be the possible options. should it be jquery , javascript or sth else ? and how can i implement it ? Thank you very much.  

IDragSource bug over a hidden (display:none) table row with IE browser

I'm currently trying to create an Extender to move Gridview row order. Some of they are hidden by setting their property display to 'none'.Because the gridview act like a treeview with node that can be expanded or collapsed.From there all is well working, except with Internet explorer !Here is the problem :    When hiding a row, the drag operation works properly until the mouse reach a row having one or more preceding row hiddens.I create a some code to reproduce the bug.    1 - Open the sample in Internet Explorer and try dragging rows. You will then notice that all is well working.    2 - Now, click on the button "Toggle rows display" and retry dragging row 1 over the row 10. You will notice that when the mouse reach the row 5,          the drag operation stuck on the header of the table.    Now open the sample in FireFox, Google Chrome, Safari and repeat the same operation. You will notice that all is well working.ASPX Page :<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test3.aspx.cs" Inherits="Test3" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml&

How to display the image in the screen from the scanner directly

Hi friends,The scanner connected to my PC. now i need to develope the application to display the images when ever the files are scanning in the scanner machine.i want to display the images directly from the scanner. is there any way to do this? pls help me out.. thanks in advance.. 

Is it possible to display 16 bit grayscale .TIFF image in WPF ?

Is there a way to display a 16 bit TIFF image in a WPF image control  ? Currently the image shows up as black. If I use freeware programs like Irfanview, the image is displayed correclty (although it is converted to 8 bit grayscale). Is there anyway to display the grayscale .tiff image in the WPF image control ?

How do I display my animated image while the next page loads?

I have the following code so it'll show an animated progress GIF but if the site takes longer than this, it will quit. Is there a more effective way?System.Threading.Thread.Sleep(2000) Here's my update progress code:<asp:UpdateProgress ID="UpdateProgress1" runat="server"> <ProgressTemplate> <div class="PleaseWait"> Please wait ... </div> </ProgressTemplate> </asp:UpdateProgress>  

Display a Web User Control in the Web Browser control of WinForms

Does anyone have an example of how to do this, or can you point me to a good tutorial that explains how to do this? Thanks

Jquery to display image map in sharepoint


I need to use google maps in sharepoint site .

and need to highlight on mouseover location stored in the list.

this list contains location name and co-ordinates of the location.

how can I use Jquery to display image map in sharepoint.Plesae give some initial thoughts.


Client image files uploaded to Server are staying locked when accessed again.


I have a web form that, upon user request, uploads an image file from the client to a server folder, makes a thumbnail and saves to another folder than sets an imageurl of an image control to that thumbnail. All fine up to here, problem is that at times (not always but could not find the exact pattern) when uploading an existing file, it throws a ' ... file used by another process ... ' error, both on the original image file and the created thumbnail. Is there a way to prevent the locking of these files or alternately, which object need I destroy to release the image file and avoid these contentions? I do destroy the image object immediately after thumbnail is created. Ideas anyone?

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