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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsegoy1979
    New Member
    • Jun 2008
    • 30

    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
    Code:
    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
        <script language="javascript" type="text/javascript">
        function test()
            {
            debugger;
            var str;
            str=document.getElementById("FileUpload1").value;
            alert(document.getElementById("FileUpload1").value);
            window.open('DisplayImage.aspx?url='+str,'','height=300,Width=300,Status=no,toolbar=no,Menubar=no,Location=noresizable=yes');
            }
        </script>    
        
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
           <table>
            <tr>
                <td>
                    <asp:FileUpload ID="FileUpload1" runat="server" Height="25px" Width="240px" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnUpload" runat="server" Text="Button" OnClientClick ="test()"  />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblmessage" runat="server" Text="Label"></asp:Label>
                </td>
            </tr>
           </table>
        </div>
        </form>
    </body>
    </html>
    [code]
    //page in which image is displayed
    Code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DisplayImage.aspx.cs" Inherits="DisplayImage" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <table>
            <tr>
            <td>
                
           
                <asp:Image ID="Image1"  runat="server" Height="200px" Width="200px" />
            </td>
            </tr>
        </table>
        </div>
        </form>
    </body>
    </html>
    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
  • hsegoy1979
    New Member
    • Jun 2008
    • 30

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

    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


    [code=asp]
    <%@ Page Language="C#" AutoEventWireup ="true" CodeFile="Defau lt.aspx.cs" Inherits="_Defa ult" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Untitl ed Page</title>
    <script language="javas cript" type="text/javascript">
    function test()
    {
    debugger;
    var str;
    str=document.ge tElementById("F ileUpload1").va lue;
    alert(document. getElementById( "FileUpload1"). value);
    window.open('Di splayImage.aspx ?url='+str,'',' heigh t=300,Width=300 ,Status=no,tool bar=no,Menubar= no,Lo cation=noresiza ble=yes');
    }
    </script>

    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <table>
    <tr>
    <td>
    <asp:FileUplo ad ID="FileUpload1 " runat="server" Height="25px" Width="240px" />
    </td>
    </tr>
    <tr>
    <td>
    <asp:Button ID="btnUpload" runat="server" Text="Button" OnClientClick ="test()" />
    </td>
    </tr>
    <tr>
    <td>
    <asp:Label ID="lblmessage " runat="server" Text="Label"></asp:Label>
    </td>
    </tr>
    </table>
    </div>
    </form>
    </body>
    </html>

    [/code]

    //page in which image is displayed
    Code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DisplayImage.aspx.cs" Inherits="DisplayImage" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <table>
            <tr>
            <td>
                
           
                <asp:Image ID="Image1"  runat="server" Height="200px" Width="200px" />
            </td>
            </tr>
        </table>
        </div>
        </form>
    </body>
    </html>
    [code=cpp]
    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 = new Uri(s).ToString ();
    Image1.Visible = true;
    Response.Write( s);
    }
    }
    }
    [/code]
    thankx in advance

    yogesh
    Last edited by Frinavale; Jun 27 '08, 08:30 PM. Reason: added [code] tags

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Originally posted by hsegoy1979
      //page in which image is displayed
      Code:
      <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DisplayImage.aspx.cs" Inherits="DisplayImage" %>
       
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
       
      <html xmlns="http://www.w3.org/1999/xhtml" >
      <head runat="server">
          <title>Untitled Page</title>
      </head>
      <body>
          <form id="form1" runat="server">
          <div>
          <table>
              <tr>
              <td>
                  
             
                  <asp:Image ID="Image1"  runat="server" Height="200px" Width="200px" />
              </td>
              </tr>
          </table>
          </div>
          </form>
      </body>
      </html>
      [code=cpp]
      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 = new Uri(s).ToString ();
      Image1.Visible = true;
      Response.Write( s);
      }
      }
      }
      [/code]
      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

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Originally posted by Frinavale
        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.

        Comment

        • hsegoy1979
          New Member
          • Jun 2008
          • 30

          #5
          Originally posted by insertAlias
          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

          Comment

          • hsegoy1979
            New Member
            • Jun 2008
            • 30

            #6
            I want to display image in server machine and image resides in client machine

            I want to display image in server machine and image resides in client machine using asp.net c#

            Regards
            Yogesh

            Comment

            • Curtis Rutland
              Recognized Expert Specialist
              • Apr 2008
              • 3264

              #7


              Don't double post. Bump your old thread if necessary.

              Comment

              • Frinavale
                Recognized Expert Expert
                • Oct 2006
                • 9749

                #8
                Originally posted by hsegoy1979
                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

                Comment

                Working...