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
10 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Francis SusaimichaelPosted Nov 19, 2015, 6:37 AM
Francis SusaimichaelPosted Nov 19, 2015, 7:15 AM
Rajveer singhPosted Nov 19, 2015, 6:45 AM
Rajveer singhPosted Nov 19, 2015, 6:14 AM
Francis SusaimichaelPosted Nov 19, 2015, 5:51 AM
Rajveer singhPosted Nov 19, 2015, 5:34 AM
Francis SusaimichaelPosted Nov 19, 2015, 5:25 AM
Raja TPosted Nov 19, 2015, 1:19 AM
Rajveer singhPosted Nov 19, 2015, 1:08 AM
Raja TPosted Nov 19, 2015, 12:04 AM