472,145 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

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

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 2158
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 Expert Mod 8TB
//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 Expert 2GB
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
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
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 Expert 2GB
http://bytes.com/forum/thread800754.html

Don't double post. Bump your old thread if necessary.
Jun 30 '08 #7
Frinavale
9,735 Expert Mod 8TB
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

Post your reply

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

Similar topics

1 post views Thread by John | last post: by
8 posts views Thread by UJ | last post: by
4 posts views Thread by bissatch | last post: by
4 posts views Thread by huntingseasonson | last post: by
6 posts views Thread by =?Utf-8?B?TWlybw==?= | last post: by
5 posts views Thread by OBAFGKM_RNS | last post: by
4 posts views Thread by Andrew Bailey | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

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.