protected void Feedback_Click(object sender, EventArgs e) { try { WebGLApp1.Feedback.CreateFeedbackTable(); } catch(Exception) { } string Uname = Session["username"].ToString(); string Fname = Session["filename"].ToString(); string Object="Object1"; string Fback=TextBox1.Text; WebGLApp1.Feedback.InsertFeedBack(Uname, Fname, Object, Fback); TextBox1.Text = null; BindGridviewDataFeedback(Fname); } protected void lnkLoadModel_Click(object sender, EventArgs e) { LinkButton lnkbtn = sender as LinkButton; GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow; int fileid = -1; for (int cnt = 0; cnt < gvDetails.Rows.Count; cnt++) { if (gvrow.RowIndex == gvDetails.Rows[cnt].RowIndex) { fileid = cnt; break; } } //int nFieldCount = gvDetails.Rows[fileid].Cells.Count; string Name = gvDetails.Rows[fileid].Cells[0].Text.Trim(); //Name = gvDetails.Rows[fileid].Cells[1].Text; Session["filename"] = Name; using (SqlConnection con = new SqlConnection(strCon)) { using (SqlCommand cmd = new SqlCommand()) { cmd.CommandText = "Use iVizDatabase;select FileName, FileType, FileData from FileManager where Number=@ID "; cmd.Parameters.AddWithValue("@Id", fileid+1); cmd.Connection = con; con.Open(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { Response.ContentType = dr["FileType"].ToString(); Response.AddHeader("Content-Disposition", "attachment;filename=\"" + Name + "\""); Response.BinaryWrite((byte[])dr["FileData"]); Response.End(); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)