Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 3rd, 2007, 12:35 AM
Authorized User
 
Join Date: Jun 2007
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Image preview not working in IE7.Please help

Hi,

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;

                }

            }

        }

   </script>...

<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)
{

alert(obj.value);


img.setAttribute("ImageUrl",obj.value);
}

}

}

</script>

<body>



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

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

</body>


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.






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





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