Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| 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 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 August 28th, 2009, 11:52 AM
Authorized User
Points: 270, Level: 5
Points: 270, Level: 5 Points: 270, Level: 5 Points: 270, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default Image Control Display Error- IE 7

Hi All,

I am working on vb.net 2.0.
I need to display images which are selected using a fileupload control on an Image Control. I am able to display it in IE 6 Browser. But the images are not displayed in the IE 7 browser.What could be the reason. And help me to display the image properly in any browser.

Any help appreciated.


Sumith.
__________________
sumith
 
Old September 11th, 2009, 07:40 AM
Friend of Wrox
 
Join Date: May 2006
Location: Northampton, United Kingdom.
Posts: 107
Thanks: 1
Thanked 8 Times in 7 Posts
Default

Add ClientTarget="uplevel" as shown below to your .aspx file and see if that works


<%
@PageLanguage="VB"Debug="true"AutoEventWireup="false"CodeFile="Default.aspx.vb"Inherits="_Default" ClientTarget="uplevel"%>
 
Old October 1st, 2009, 06:06 AM
Authorized User
Points: 270, Level: 5
Points: 270, Level: 5 Points: 270, Level: 5 Points: 270, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi frnds,
My code I am pasting below:
---------------------------------
Code:
<asp:FileUpload ID="FileUpload1" runat="server" CssClass="fileupload" EnableViewState="true"    onChange="return UploadImage(document.getElementById('FileUpload1').value)" Width="260px"/>

function UploadImage(urlClientSide)
{                    document.getElementById('<%=me.ImgShip.ClientID%>').src=urlClientSide;                  
return false;
 }


Also I have added ClientTarget="uplevel" to my aspx file. But its not displaying the image still.Any help appreciated.


Sumith.
__________________
sumith
 
Old October 1st, 2009, 07:03 AM
Friend of Wrox
 
Join Date: May 2006
Location: Northampton, United Kingdom.
Posts: 107
Thanks: 1
Thanked 8 Times in 7 Posts
Default

Try writing the file name uploaded (including the location) into a label or text box

Then create an image on a page with this is the source and see if it loads in all browsers.

eg add to your Transfer to server routine

ImageSRCTextBox.Text="<IMG SRC=\images\"& FileUpload1.FileName.ToString &">"


ImageSRCTextBox is a text box
FileUpload1 is the file upload control
and it assumes you are uploading the image to a folder on the server called images

It may help show you where the error is occuring.
 
Old October 5th, 2009, 12:25 PM
Authorized User
Points: 270, Level: 5
Points: 270, Level: 5 Points: 270, Level: 5 Points: 270, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Friend,

I need to display the selected image on the Image control each time the user selects an image using FileUpload control. After selecting an image user can save the same by clicking on the "Save" button.

So,at the time of selection (using fileupload control), we are not saving the image. On the "Save" button click only, the image is saved into the specified folder.

I am able to display the image on IE 6 but not on IE 7. How can I solve this ?.
__________________
sumith
 
Old October 5th, 2009, 01:52 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

I think you've been skating around the issue. The code samples you've talked about are server side .NET code. This is executed on the server and happens the same way everytime. If it works fine in IE6, then this can't be the problem.

Browser compatibility issues are always with client side technolgies, XHTML, CSS, or Javascript. I don't see anything in what you've provided that triggers any alarm bells; can you provide the relevant output information. We need to see what the browser is processing, the server side code isn't doing me much good.
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old October 6th, 2009, 02:39 AM
Authorized User
Points: 270, Level: 5
Points: 270, Level: 5 Points: 270, Level: 5 Points: 270, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi, Yes. I need the solution for client-side.I have written a function on &quot;Onchange&quot; event of FileUpload control.This will get the path from Fileupload control and display the selected image on the Image Control. Code is pasted below:
Code:
function UploadImage(urlClientSide){                    document.getElementById('').src=urlClientSide;                  return false; }
This piece of code only I am using on the client - side. Please go thru it and suggest me whatever is possible to fix my issue.
__________________
sumith

Last edited by sumith; October 6th, 2009 at 02:47 AM..
 
Old October 7th, 2009, 12:20 AM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

This is pretty slick, I've never tried this with a FileUpload control, not that I've worked with them much. It looks like the key piece is...

document.getElementById('<%=me.ImgShip.ClientID%>' ).src=urlClientSide;where me.ImgShip.ClientID is the location of the file on the user's computer before it's uploaded? If so, is this well supported? I would think a lot of computers would throw security issues when you start accessing files; does the fact that this is a file the user has selected in the file upload control "soothe" the security level so this works, or are the incompatibility issues depending on the user's OS security settings? Just interested.

There doesn't seem to be anything that rings any bells with me. What's the XHTML for the element you're resetting the src on in the script? Is the image appearing on the page, or in a modal dialog with a confirm button?
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old October 28th, 2009, 05:57 AM
Friend of Wrox
 
Join Date: May 2006
Location: Northampton, United Kingdom.
Posts: 107
Thanks: 1
Thanked 8 Times in 7 Posts
Default

What happens if you add

<meta http-equiv="X-UA-Compatible" content="IE-EmulateIE7"/>

to the <head> section of the .aspx page.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload image-create & save thumbnail-display image angshujit ASP.NET 2.0 Professional 6 July 11th, 2013 10:34 PM
Loading Image to Image Control using JavaScript ctranjith General .NET 1 May 28th, 2013 05:43 AM
Display of image sanjay mishra .NET Web Services 4 September 15th, 2009 12:41 AM
help with image display dhillon555 ASP.NET 1.0 and 1.1 Basics 21 February 19th, 2007 03:32 PM
How to Display the image from the image field. mikeparams SQL Server 2000 1 October 29th, 2004 02:23 AM





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