C#:
string cs = ConfigurationManager.ConnectionStrings["Myconnectionstring1"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(cs);
SqlDataAdapter sda = new SqlDataAdapter("select * from Uploadpdf", con);
DataTable ds = new DataTable();
sda.Fill(ds);
DataList1.DataSource = ds;
DataList1.DataBind();
}
----------------------------------------------------------------------------------------------------------------
Design:
#Container1{
background-color:#808080;
}
Text='<%# Eval("Name") %>'
NavigateUrl='name'
ForeColor="#000099"
Font-Bold="True"
Font-Size="Large"
Height="100"
Width="100">
Id:
Name:
$(document).on("click", "[id*=HyperLink1]", function () {
var fileName = $(".Name", $(this).closest("tr")).html();
$("#dialog").dialog({
title: "View Details",
buttons: {
Ok: function () {
$(this).dialog('close');
}
},
open: function () {
var object = "
object += "If you are unable to view file, you can download from here";
object += " or download Adobe PDF Reader to view the file.";
object += "";
object = object.replace(/{FileName}/g, "PdfFiles/" + fileName);
$("#dialog").html(object);
},
modal: true
});
return false;
});