|
|
 |
| 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.
|
 |

August 28th, 2009, 12:52 PM
|
|
Authorized User
|
|
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

September 11th, 2009, 08:40 AM
|
|
Authorized User
|
|
Join Date: May 2006
Location: , , United Kingdom.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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"%>
|

October 1st, 2009, 07:06 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

October 1st, 2009, 08:03 AM
|
|
Authorized User
|
|
Join Date: May 2006
Location: , , United Kingdom.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

October 5th, 2009, 01:25 PM
|
|
Authorized User
|
|
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

October 5th, 2009, 02:52 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 278
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
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.
|

October 6th, 2009, 03:39 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Location: thrissur, kerala, India.
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi, Yes. I need the solution for client-side.I have written a function on "Onchange" 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.
|

October 7th, 2009, 01:20 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 278
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
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.
|

October 28th, 2009, 06:57 AM
|
|
Authorized User
|
|
Join Date: May 2006
Location: , , United Kingdom.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
What happens if you add
<meta http-equiv="X-UA-Compatible" content="IE-EmulateIE7"/>
to the <head> section of the .aspx page.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |