Hi,
uini:So the main question is why , by using ajax , the url gets this unnecessary "#".
Because you add the # to the link, and not ajax.
You are using links in your gridview to show the details popup, here is some exact copy form your code which seen by the browser (you can see it with "view source" in the browser):
...
<td>
<a id="ctl00_ContentPlaceHolder1_gvAppartsList_ctl11_aMoreDetails" onclick="getAppartDetails('','7')" href="#">Details</a>
</td>
...
This won't work, you need to change your template generation to get something like this (find your asp:hyperlink controls in the gridview template and change the href to "javascript:{}", that's all you need)
<td>
<a id="ctl00_ContentPlaceHolder1_gvAppartsList_ctl11_aMoreDetails" onclick="getAppartDetails('','7')" href="javascript:{}">Details</a>
</td>