Hi all
I ended up doing a SQL select in code and then used a label to place an iFrame where I needed it. Here is the iFrame label code where Var1 is a querystring with the ArticleID from the calling page.
Label1.Text =
"<iframe src='ShowPDF.aspx?ArticleID=" & Var1 & "' width='750px' height='650px'></iframe>"
Note that this iFrame calls another aspx page which renders the pdf. This rendering page is extremely simple in code. Here is the page code. It uses the same querystring to get the article from SQL. All code is inline; there is no code behind.
<%
@ Page Language="VB" %>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
Dim Var1 As String
Var1 = Request.QueryString(
SqlDataSource1.SelectParameters(
dt = SqlDataSource1.Select(DataSourceSelectArguments.Empty)
docbyte = dt(0)(0)
Response.ContentType =
"ArticleID")"ArticleID").DefaultValue = Var1Dim dt As System.Data.DataViewDim docbyte As Byte()"application/pdf"
Response.BinaryWrite(docbyte)
Response.End()
%>
<
script runat="server">
</
<
<
script>html xmlns="http://www.w3.org/1999/xhtml">head runat="server">
</
<
<title></title>head>body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:gunk %>" SelectCommand="SELECT Article FROM gunk_articles where articleid=@ArticleID">
<SelectParameters>
<asp:Parameter Name="ArticleID" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</
</
</
form>body>html>