my UI
"My moto click any link open pdf file in new window but i want not use query string for security purpose"

my aspx .code
GridLines="None" Width="900px" CssClass="gridview" DataKeyNames="idno"
HeaderStyle-CssClass="header" RowStyle-CssClass="rows"
onrowdatabound="GridView1_RowDataBound">
<%#Container.DataItemIndex+1 %>
cs code on row databound
{
string filepath = "WriteReadData/documents/";
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink hl = (HyperLink)e.Row.FindControl("bnv");
if (hl != null)
{
DataRowView drv = (DataRowView)e.Row.DataItem;
Session["id"] = drv["idno"].ToString();
//string lsDataKeyValue = GridView1.DataKeys[e.Row.RowIndex].Values[0].ToString();
SqlConnection con = new SqlConnection(str);
string query = "select filename from level3 where link_level3='" + hl.Text + "' ";
SqlCommand cmd = new SqlCommand(query,con);
con.Open();
string file_name = (string)cmd.ExecuteScalar();
con.Close();
if (file_name != null)
{
hl.NavigateUrl = filepath + file_name;
}
}
}
}
Error generate on page load

how to solves this please guid me
Thanks


Francis SusaimichaelRank #466 · 5.4K reputationPosted Nov 19, 2015, 1:37 AM EST
Raja TRank #685 · 3.5K reputationPosted Nov 18, 2015, 7:04 PM EST
Rajveer singhRank #1,510 · 1.1K reputationPosted Nov 18, 2015, 8:08 PM EST
Raja TRank #685 · 3.5K reputationPosted Nov 18, 2015, 8:19 PM EST
Francis SusaimichaelRank #466 · 5.4K reputationPosted Nov 19, 2015, 12:25 AM EST
Rajveer singhRank #1,510 · 1.1K reputationPosted Nov 19, 2015, 12:34 AM EST
Francis SusaimichaelRank #466 · 5.4K reputationPosted Nov 19, 2015, 12:51 AM EST
Rajveer singhRank #1,510 · 1.1K reputationPosted Nov 19, 2015, 1:14 AM EST
Rajveer singhRank #1,510 · 1.1K reputationPosted Nov 19, 2015, 1:45 AM EST
Francis SusaimichaelRank #466 · 5.4K reputationPosted Nov 19, 2015, 2:15 AM EST