Please refer the following article.
As in the article the record is fetched from the database on the View PDF link click and an Ajax call is made to the WebMethod to retrieve the data and OnSuccess method displayed in the DIV.
You need to place the DIV in the page where you want to display.
Also add the JavaScript code and the WebMethod in that page also.
Remove the fileId passed as parameter to the WebMethod and set the SqlCommand parameter with your QueryString value.