473,503 Members | 1,656 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.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string s;
if (!IsPostBack)
{
s = Request.QueryString["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 2389
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
3348
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...
2
1995
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,...
1
2045
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...
8
1245
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...
4
2457
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...
4
9607
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...
6
1991
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.......
5
1739
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....
4
1767
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...
0
7198
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,...
0
7271
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,...
0
7319
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...
1
6979
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...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4998
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3160
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...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
373
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.