Although you have clearly mentioned that the image button is not inside any control like gridview or datalist, still I'll ask, are you sure?
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="images/icon-continue-shopping-4-150x49.jpg" PostBackUrl="<%#"Order_Details.aspx?pid="+Eval("ProductID") %>" />
What
Eval("ProductID") should evaluate to?
Just for a test you can try replacing the above snippet with
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="images/icon-continue-shopping-4-150x49.jpg" PostBackUrl="Order_Details.aspx?pid=1" />
It should redirect to
Order_Details.aspx with pid=1 and the logic you have written will be executed.
I am sure, you want this image button to redirect somewhere else.
You can also use
OnClick event if want to do it other way.
In case, your problem is not resolved, please let me know :)