p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
I forgot my password Register Now
Register | 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 28th, 2009, 12:52 PM
Authorized User
Points: 210, Level: 4
Points: 210, Level: 4 Points: 210, Level: 4 Points: 210, Level: 4
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 42
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 11th, 2009, 08:40 AM
Authorized User
Points: 227, Level: 4
Points: 227, Level: 4 Points: 227, Level: 4 Points: 227, Level: 4
Activity: 10%
Activity: 10% Activity: 10% Activity: 10%
 
Join Date: May 2006
Location: , , United Kingdom.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 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"%>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old October 1st, 2009, 07:06 AM
Authorized User
Points: 210, Level: 4
Points: 210, Level: 4 Points: 210, Level: 4 Points: 210, Level: 4
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 42
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old October 1st, 2009, 08:03 AM
Authorized User
Points: 227, Level: 4
Points: 227, Level: 4 Points: 227, Level: 4 Points: 227, Level: 4
Activity: 10%
Activity: 10% Activity: 10% Activity: 10%
 
Join Date: May 2006
Location: , , United Kingdom.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old October 5th, 2009, 01:25 PM
Authorized User
Points: 210, Level: 4
Points: 210, Level: 4 Points: 210, Level: 4 Points: 210, Level: 4
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 42
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old October 5th, 2009, 02:52 PM
Friend of Wrox
Points: 941, Level: 11
Points: 941, Level: 11 Points: 941, Level: 11 Points: 941, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 278
Thanks: 0
Thanked 4 Times in 4 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old October 6th, 2009, 03:39 AM
Authorized User
Points: 210, Level: 4
Points: 210, Level: 4 Points: 210, Level: 4 Points: 210, Level: 4
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 42
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 03:47 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #8 (permalink)  
Old October 7th, 2009, 01:20 AM
Friend of Wrox
Points: 941, Level: 11
Points: 941, Level: 11 Points: 941, Level: 11 Points: 941, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 278
Thanks: 0
Thanked 4 Times in 4 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #9 (permalink)  
Old October 28th, 2009, 06:57 AM
Authorized User
Points: 227, Level: 4
Points: 227, Level: 4 Points: 227, Level: 4 Points: 227, Level: 4
Activity: 10%
Activity: 10% Activity: 10% Activity: 10%
 
Join Date: May 2006
Location: , , United Kingdom.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What happens if you add

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

to the <head> section of the .aspx page.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Display of image sanjay mishra .NET Web Services 4 September 15th, 2009 01:41 AM
help with image display dhillon555 ASP.NET 1.0 and 1.1 Basics 21 February 19th, 2007 03:32 PM
Upload image-create & save thumbnail-display image angshujit ASP.NET 2.0 Professional 5 January 11th, 2007 09:08 AM
Loading Image to Image Control using JavaScript ctranjith General .NET 0 December 21st, 2004 08:44 AM
How to Display the image from the image field. mikeparams SQL Server 2000 1 October 29th, 2004 03:23 AM



All times are GMT -4. The time now is 04:30 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc