Iframe is not working
-
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; } }
-
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; } }
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
-
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