I can give you an example with c#
First Create
Default.aspx and paste code
<![CDATA[
Default.cs
String ConnectionString = ConfigurationManager.ConnectionStrings["YourConnectionStringsname"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
DatabindFileList();
}
}
public void DatabindFileList()
{
try
{
SqlConnection con = new SqlConnection(ConnectionString);
SqlCommand cmd = new SqlCommand("SP_DataBindFileList", con);
cmd.CommandType = CommandType.StoredProcedure;
con.Open();
grdviewFileList.EmptyDataText = "No Records Found";
grdviewFileList.DataSource = cmd.ExecuteReader();
grdviewFileList.DataBind();
lbltotalRow.Text = "Total : " + Convert.ToString(grdviewFileList.Rows.Count) + " Records found" + "<br />";
}
catch
{
}
}
protected void DownloadFile(object sender, EventArgs e)
{
string filePath = (sender as LinkButton).CommandArgument;
iframe.Attributes.Add("src", filePath);
this.ModalPopupExtender1.Show();
}
if you are work with VB.net Please Convert C# to VB