Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Iframe is not working

Iframe is not working

Scheduled Pinned Locked Moved ASP.NET
designhelpdatabasedockerxml
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vineesh v
    wrote on last edited by
    #1

    Urgent Please help.. I am trying to display a file(.doc,.pdf or .img) from database to iframe embeded in a gridview. i have used the following code below. its showing error. The error is The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. Invalid at the top level of the document. Error processing resource 'http://localhost:2809/WebSite3/getimage.aspx?ID=11'. ... {\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshf ^ In MainPage.aspx public partial class Default8 : System.Web.UI.Page { ClsData clsd = new ClsData(); string sqlstr; DataSet ds = new DataSet(); protected void Page_Load(object sender, EventArgs e) { sqlstr = "select ID,Extension,Content from TestTable "; ds = clsd.SelectDataSet(sqlstr, "temp"); Gridview1.DataSource = ds; Gridview1.DataBind(); } } The design is

    <![CDATA[<%# "getimage.aspx?ID=" + DataBinder.Eval(Container.DataItem,"ID") %>]]>' id="MyIframe" />

    In getimage.aspx public partial class getimage : System.Web.UI.Page { ClsData cdtd = new ClsData(); DataSet ds = new DataSet(); protected void Page_Load(object sender, EventArgs e) { try { IDataReader dr = null; string id = Request.QueryString["ID"].ToString(); string sqlstr = "SELECT Content FROM TestTable where ID='" + id + "'"; dr = cdtd.SelectReader(sqlstr); dr.Read(); byte[] byear = (byte[])dr["Content"]; Response.ContentType = dr["Content"].ToString(); Response.BinaryWrite(byear); } catch (Exception ex) { throw ex; } }

    N 1 Reply Last reply
    0
    • V vineesh v

      Urgent Please help.. I am trying to display a file(.doc,.pdf or .img) from database to iframe embeded in a gridview. i have used the following code below. its showing error. The error is The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. Invalid at the top level of the document. Error processing resource 'http://localhost:2809/WebSite3/getimage.aspx?ID=11'. ... {\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshf ^ In MainPage.aspx public partial class Default8 : System.Web.UI.Page { ClsData clsd = new ClsData(); string sqlstr; DataSet ds = new DataSet(); protected void Page_Load(object sender, EventArgs e) { sqlstr = "select ID,Extension,Content from TestTable "; ds = clsd.SelectDataSet(sqlstr, "temp"); Gridview1.DataSource = ds; Gridview1.DataBind(); } } The design is

      <![CDATA[<%# "getimage.aspx?ID=" + DataBinder.Eval(Container.DataItem,"ID") %>]]>' id="MyIframe" />

      In getimage.aspx public partial class getimage : System.Web.UI.Page { ClsData cdtd = new ClsData(); DataSet ds = new DataSet(); protected void Page_Load(object sender, EventArgs e) { try { IDataReader dr = null; string id = Request.QueryString["ID"].ToString(); string sqlstr = "SELECT Content FROM TestTable where ID='" + id + "'"; dr = cdtd.SelectReader(sqlstr); dr.Read(); byte[] byear = (byte[])dr["Content"]; Response.ContentType = dr["Content"].ToString(); Response.BinaryWrite(byear); } catch (Exception ex) { throw ex; } }

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      vineesh v wrote:

      Urgent

      Please read this[^]. It's very URGENT

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      E 1 Reply Last reply
      0
      • N N a v a n e e t h

        vineesh v wrote:

        Urgent

        Please read this[^]. It's very URGENT

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        E Offline
        E Offline
        eyeseetee
        wrote on last edited by
        #3

        thats just a great answer

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups