Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 3rd, 2007, 12:35 AM
Authorized User
Join Date: Jun 2007
Location: , , .
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Image preview not working in IE7.Please help


I have an application that opens a file dialog. You can select an image and after that you can see it in a preview image tag.

The preview images on client side works fine in IE6, but not IE7.

This preview does not need postback to the server .

 Can this script work in IE 7?

<script language="javascript" type="text/javascript">
      function ChangeLogo(obj)


            if (obj != null)


                var img = document.getElementById("imgLogo");

                if (img != null)


                    img.src = obj.value;





<asp:Image ID="imgLogo" BorderWidth="1px" BorderColor="CornflowerBlue" ImageUrl="~/images/empty_logo.jpg" Width="60px" runat="server" />

<asp:FileUpload OnChange="ChangeLogo(this);" BorderColor="CornflowerBlue" ID="fuLogo" Width="170px" />

The code above is working in IE 6.But not in IE 7.

So used the code below.But the image is still not displayed in IE 7.

The code snippet I used is:

<script type="text/javascript" language="javascript">

function ChangeLogo(obj)

document.getElementById("<%=imgPhoto.ClientID %>").style.visibility='visible';vbvbvbif (obj != null)

var img = document.getElementById("<%=imgPhoto.ClientID %>");

if (img != null)







<asp:Image ID="imgPhoto" runat="server" Width="100px" Height="100px" style="visibility:hidden" />

<asp:FileUpload ID="filePhoto" runat="server" onchange="javascript:ChangeLogo(this);" />


Then also image is not displyed.What shall i do?

I want to show image preview in my page.Please give a solution for this issue..

Thank You,
Subhashni Palanivel.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IE7 script not working on linux server luminus BOOK: CSS Instant Results 9 February 1st, 2016 07:35 AM
IE7 print preview problem nasirmunir HTML Code Clinic 1 June 25th, 2008 08:37 AM
print preview problem with IE7 nasirmunir CSS Cascading Style Sheets 1 June 25th, 2008 08:36 AM
Background image in IE7 Samurai CSS Cascading Style Sheets 0 May 21st, 2008 10:46 PM
IE7 and parent.location not working? Camer Javascript How-To 2 April 24th, 2007 09:30 AM

All times are GMT -4. The time now is 07:13 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.