473,699 Members | 2,364 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image is displaying in Internet Explorer 6.0 but not in I.E. 7.0

30 New Member
Dear All
Iam using file upload control and i want to display image in another pop up page
.But image is not displaying in image control iam sending image path thru querystring . here is my code
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml" >
  6. <head runat="server">
  7.     <title>Untitled Page</title>
  8.     <script language="javascript" type="text/javascript">
  9.     function test()
  10.         {
  11.         debugger;
  12.         var str;
  13.         str=document.getElementById("FileUpload1").value;
  14.         alert(document.getElementById("FileUpload1").value);
  15.         window.open('DisplayImage.aspx?url='+str,'','height=300,Width=300,Status=no,toolbar=no,Menubar=no,Location=noresizable=yes');
  16.         }
  17.     </script>    
  18.  
  19. </head>
  20. <body>
  21.     <form id="form1" runat="server">
  22.     <div>
  23.        <table>
  24.         <tr>
  25.             <td>
  26.                 <asp:FileUpload ID="FileUpload1" runat="server" Height="25px" Width="240px" />
  27.             </td>
  28.         </tr>
  29.         <tr>
  30.             <td>
  31.                 <asp:Button ID="btnUpload" runat="server" Text="Button" OnClientClick ="test()"  />
  32.             </td>
  33.         </tr>
  34.         <tr>
  35.             <td>
  36.                 <asp:Label ID="lblmessage" runat="server" Text="Label"></asp:Label>
  37.             </td>
  38.         </tr>
  39.        </table>
  40.     </div>
  41.     </form>
  42. </body>
  43. </html>
  44.  
  45.  
[code]
//page in which image is displayed
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DisplayImage.aspx.cs" Inherits="DisplayImage" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml" >
  6. <head runat="server">
  7.     <title>Untitled Page</title>
  8. </head>
  9. <body>
  10.     <form id="form1" runat="server">
  11.     <div>
  12.     <table>
  13.         <tr>
  14.         <td>
  15.  
  16.  
  17.             <asp:Image ID="Image1"  runat="server" Height="200px" Width="200px" />
  18.         </td>
  19.         </tr>
  20.     </table>
  21.     </div>
  22.     </form>
  23. </body>
  24. </html>
  25.  
public partial class DisplayImage : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{
string s;
if (!IsPostBack)
{
s = Request.QuerySt ring["url"].ToString();
//Image1.Src = s;

//Image1 = new Image();
Image1.ImageUrl = s.ToString();
Image1.Visible = true;
Response.Write( s);
}
}
}

thankx in advance

yogesh
Jun 27 '08 #1
7 2401
hsegoy1979
30 New Member
Dear All
I have created an application to diaplay image in popup window. In Internet explorer 6.0 image is displayed but not in Internet Explorer 7.0
Here is my code
Dear All
Iam using file upload control and i want to display image in another pop up page
.But image is not displaying in image control iam sending image path thru querystring . here is my code


Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml" >
  6. <head runat="server">
  7.     <title>Untitled Page</title>
  8.     <script language="javascript" type="text/javascript">
  9.     function test()
  10.         {
  11.         debugger;
  12.         var str;
  13.         str=document.getElementById("FileUpload1").value;
  14.         alert(document.getElementById("FileUpload1").value);
  15.         window.open('DisplayImage.aspx?url='+str,'','heigh  t=300,Width=300,Status=no,toolbar=no,Menubar=no,Lo  cation=noresizable=yes');
  16.         }
  17.     </script>    
  18.  
  19. </head>
  20. <body>
  21.     <form id="form1" runat="server">
  22.     <div>
  23.        <table>
  24.         <tr>
  25.             <td>
  26.                 <asp:FileUpload ID="FileUpload1" runat="server" Height="25px" Width="240px" />
  27.             </td>
  28.         </tr>
  29.         <tr>
  30.             <td>
  31.                 <asp:Button ID="btnUpload" runat="server" Text="Button" OnClientClick ="test()"  />
  32.             </td>
  33.         </tr>
  34.         <tr>
  35.             <td>
  36.                 <asp:Label ID="lblmessage" runat="server" Text="Label"></asp:Label>
  37.             </td>
  38.         </tr>
  39.        </table>
  40.     </div>
  41.     </form>
  42. </body>
  43. </html>
  44.  
  45.  
//page in which image is displayed
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DisplayImage.aspx.cs" Inherits="DisplayImage" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml" >
  6. <head runat="server">
  7.     <title>Untitled Page</title>
  8. </head>
  9. <body>
  10.     <form id="form1" runat="server">
  11.     <div>
  12.     <table>
  13.         <tr>
  14.         <td>
  15.  
  16.  
  17.             <asp:Image ID="Image1"  runat="server" Height="200px" Width="200px" />
  18.         </td>
  19.         </tr>
  20.     </table>
  21.     </div>
  22.     </form>
  23. </body>
  24. </html>
  25.  
Expand|Select|Wrap|Line Numbers
  1. public partial class DisplayImage : System.Web.UI.Page
  2. {
  3. protected void Page_Load(object sender, EventArgs e)
  4. {
  5. string s;
  6. if (!IsPostBack)
  7. {
  8. s = Request.QueryString["url"].ToString();
  9. //Image1.Src = s;
  10.  
  11. //Image1 = new Image();
  12. Image1.ImageUrl= new Uri(s).ToString();
  13. Image1.Visible = true;
  14. Response.Write(s);
  15. }
  16. }
  17. }
  18.  
thankx in advance

yogesh
Jun 27 '08 #2
Frinavale
9,735 Recognized Expert Moderator Expert
//page in which image is displayed
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DisplayImage.aspx.cs" Inherits="DisplayImage" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml" >
  6. <head runat="server">
  7.     <title>Untitled Page</title>
  8. </head>
  9. <body>
  10.     <form id="form1" runat="server">
  11.     <div>
  12.     <table>
  13.         <tr>
  14.         <td>
  15.  
  16.  
  17.             <asp:Image ID="Image1"  runat="server" Height="200px" Width="200px" />
  18.         </td>
  19.         </tr>
  20.     </table>
  21.     </div>
  22.     </form>
  23. </body>
  24. </html>
  25.  
Expand|Select|Wrap|Line Numbers
  1. public partial class DisplayImage : System.Web.UI.Page
  2. {
  3. protected void Page_Load(object sender, EventArgs e)
  4. {
  5. string s;
  6. if (!IsPostBack)
  7. {
  8. s = Request.QueryString["url"].ToString();
  9. //Image1.Src = s;
  10.  
  11. //Image1 = new Image();
  12. Image1.ImageUrl= new Uri(s).ToString();
  13. Image1.Visible = true;
  14. Response.Write(s);
  15. }
  16. }
  17. }
  18.  
thankx in advance

yogesh
Why are you using Response.Write?
Response.Write sometimes puts the content before the <html> tags in the page and this could be why things are not displaying.

-Frinny
Jun 27 '08 #3
Curtis Rutland
3,256 Recognized Expert Specialist
Why are you using Response.Write?
Response.Write sometimes puts the content before the <html> tags in the page and this could be why things are not displaying.

-Frinny
As far as I've seen, Response.Write always puts the content before the <html> tags.
Jun 27 '08 #4
hsegoy1979
30 New Member
As far as I've seen, Response.Write always puts the content before the <html> tags.
If i comment response.write then also image is not displayed in I.E. 7.0
but dispalyed in I.E. 6.0
Jun 29 '08 #5
hsegoy1979
30 New Member
I want to display image in server machine and image resides in client machine using asp.net c#

Regards
Yogesh
Jun 30 '08 #6
Curtis Rutland
3,256 Recognized Expert Specialist
http://bytes.com/forum/thread800754.html

Don't double post. Bump your old thread if necessary.
Jun 30 '08 #7
Frinavale
9,735 Recognized Expert Moderator Expert
If i comment response.write then also image is not displayed in I.E. 7.0
but dispalyed in I.E. 6.0
As a rule, do not use Response.Write because it creates invalid HTML documents.

Run your application, right click on the page rendered in the browser and select View Code. Copy the line that contains the HTML that should be displaying the image (the <img> tag) and paste it here so that we can see what's wrong with it.


-Frinny
Jun 30 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3359
by: Hari Prasad | last post by:
Hi, I have downloaded some image files by connecting to a URL and I am trying open that image file using BrowserLauncher. I am using windows xp and the default one to open image files is windows picture and Fax Viewer. I could not see the image in Internet Explorer when I am trying to open the image files. But when I set in the properties of image files from "windows picture and Fax Viewer" to "Open with internet Explorer", I could see...
2
2022
by: Koh | last post by:
My rollover image effect work fine in Netscape but not in Internet Explorer. Is there any important element or tag that I have miss out so it is not working in Internet Explorer? Below is my code, hope there is someone can help me. Thank you. <html> <head> <title>List of Products</title> <script language="JavaScript"> <!--
1
2073
by: John | last post by:
I am rotating images of different dimensions. My problem is that when a new image is displayed in a new position which had an image of a different dimension, the old image is first stretched to the dimension of the new image, before the new image is loaded. How can I stop this stretching behavior? See the banner images on the right at http://finialworld.com thank you John
8
1256
by: UJ | last post by:
I've got some HTML that produces what I need. I need to make an image of it to display on pages of my web site (I won't go in to why - just trust me - I need the image of it). The user enters some stuff that can include HTML code that I need to convert on the fly behind the scenes. Is there any way to take HTML and produce an image of what it looks like programmatically? TIA - J.
4
2467
by: bissatch | last post by:
Hi, I have launched my new website and having viewing it on the Mac Internet Explorer, have found that it isnt displaying my background-image property. Is this a common bug / occurance? How are background-image properties displayed on the Mac IE? Cheers Burnsy
4
9621
by: huntingseasonson | last post by:
Hi, I have set up the following page http://gertrudischale.com/cgi/ viewart.pl?lang=en&i=22 to scroll in the same direction one moves the mouse. This works fine -except in IE- where the image tends to flicker when the scrolling takes place. Is there an alternative way to achieve the scrolling with out the causing the flicker? The code is as follows:
6
1997
by: =?Utf-8?B?TWlybw==?= | last post by:
Hello! I've seen a lot of post about this but every one of them ends up with the same solution: Set: Response.Cache.SetExpires(new DateTime(2000, 1, 1)); // some date in the past.... Response.Cache.SetCacheability(HttpCacheability.NoCache);
5
1748
by: OBAFGKM_RNS | last post by:
I have a javascript timer on my page that counts to 10. Every half second it alternates images on my buttons from a lighter image to a darker image, giving the appearance of the buttons blinking. The problem is, when my Internet Explorer options are set to Check for newer versions of the page: Every visit to the page, IE will download those same 2 images every single time from the server. That's 20 downloads in 10 seconds for 2 images....
4
1784
by: Andrew Bailey | last post by:
Hi, Thanks for taking the time to read this. I would be very grateful if you are able to help me solve the two problems below... PROBLEM 1: I spent a lot of time finding code that would play an audio (.wav) file on a mouseover cue that would work in Internet Explorer 6 and FireFox without any user prompt to allow active-x scripts to be run etc, but unfortunately the
0
8687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7751
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.