<a id='aApp' runat='server' title='Approve' onclick='return OpenAppWin("<%#Eval("ID1") %>",
"<%#Eval("ID2") %>","<%#Eval("NAME") %>")' class='label' href='#'>Approve</a>
I need to pass 3 parameters as querystring to iframe, reason I am using runat='server' with anchor is to show user they can't click this link until they submit "remarks" which I am doing at server side i.e. disable link. Onclick I get this error Please advice any alternative or how to fix this error ?
You are enclosing double quotes withing double quote, using single and double quotes combination to avoid that.
onclick="return OpenAppWin('<%#Eval("ID1")%>','<%#Eval("ID2") %>','<%#Eval("NAME") %>');"
Edit based on comments, binding javascript event on server side
Bind javascript event in RowDataBound event on server side.
void gridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink link = (HyperLink)e.FindControl("aApp");
link.Attribute.Add("onclick", ="return OpenAppWin('"+ DataBinder.Eval(e.Row.DataItem, "ID1") + "','" + DataBinder.Eval(e.Row.DataItem, "ID2") + "', '" + DataBinder.Eval(e.Row.DataItem, "Name") + "');"
}
}