Hi quadriamer,
There is problem with single and double quotes.
So create separate function and call this function on click of anchor tag like below to handle it without confunsion.
HTML
<script type="text/javascript">
function OpenWindow(id, photo) {
window.open('Chatbox1.aspx?id=' + id + '&ph=' + photo + '', '_blank', 'location=yes,height=450,width=350,scrollbars=no,status=no');
}
</script>
<asp:GridView runat="server" ID="gvDetails" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<a onclick='OpenWindow("<%#Eval("UserID")%>","<%#Eval("Photo")%>");'>| Open Page
</a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>