protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e) { try { if (e.CommandName == "Download") { string c_id = e.CommandArgument.ToString(); //string vr_VehicleRegistrationNo = VehicleRegistrationNo.Replace("'", string.Empty); SqlDataReader sdr = uc.GetFile(c_id); if (sdr.HasRows) { sdr.Read(); string file = sdr["c_pathUploadCv"].ToString(); Response.Redirect("http://www.stayello.com/" + file + ""); } else { string text = "File Not Uploded"; ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + text + "')</script>", false); } } } catch (Exception ex) { string text = ex.Message.ToString(); ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + text + "')</script>", false); } }