Hi Priyanka88,
Try the following..
Html
<asp:GridView ID="gvPersons" runat="server" AutoGenerateColumns="false" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<a href='<%#Eval("Url")+"?Id="+Eval("Id") %>'>
<%#Eval("Id") %></a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Code
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.gvPersons.DataSource = this.GetData();
this.gvPersons.DataBind();
}
}
private DataTable GetData()
{
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Id"));
dt.Columns.Add(new DataColumn("Url"));
dt.Rows.Add(1, "WebForm1.aspx");
return dt;
}
Explanation:-
<a href='<%# "Eval("DetailedPage")?ID="+DataBinder.Eval(Container.DataItem,"ID") %>' style="text-decoration:none; font-size:small; color:#22BCE5; font-weight:bold">View More...</a></td>
Here you have kept the Eval part in double quote means it will be treated as one string like-"Eval(".
Second string will be as ")?ID=" so that DetailedPage(Which is your databinder part) will be left with nothing.
So remove your double quote form eval and try as i posted