Hi,
We tested your code with standard asp:ListBox and it works fine. Below is our full test code:
Code: HTML/ASPX
<form runat="server" id="form1">
<asp:ScriptManager runat="server" ID="sm1"></asp:ScriptManager>
<eo:ASPXToPDF runat="server" ID="ASPXToPDF1"></eo:ASPXToPDF>
<asp:Button runat="server" ID="Button1" Text="Test" onclick="Button1_Click" />
<asp:UpdatePanel ID="updatepanel1" runat="server" RenderMode="Block" UpdateMode="Conditional">
<ContentTemplate>
<table align="center" width="1089px">
<tr>
<td>
<asp:ListBox ID="cb1" runat="server" AutoPostBack="true"
onselectedindexchanged="cb1_SelectedIndexChanged1">
<asp:ListItem Value="Item1" Text="Item1">
</asp:ListItem>
<asp:ListItem Value="Item2" Text="Item2">
</asp:ListItem>
</asp:ListBox>
</td>
</tr>
</table>
<asp:PlaceHolder ID="PlaceHolder1" runat="server" Visible=false>
<table align="center" width="1089px">
<tr>
<td>
Text:
</td>
<td>
</td>
</tr>
</table>
</asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
</form>
Code: C#
protected void cb1_SelectedIndexChanged1(object sender, EventArgs e)
{
if (cb1.SelectedValue == "Item2")
{
PlaceHolder1.Visible = true;
}
else
{
PlaceHolder1.Visible = false;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
ASPXToPDF1.RenderAsPDF();
}
The basic rule for ASPXToPDF is: It renders what you see on screen as if ASPXToPDF1.RenderAsPDF was not called. In the above code, if you comment out the call inside Button1_Click, then the page will be rendered on screen with the place holder section visible (assuming you have selected "Item 2" before clicking "Test" button), so in this case it will be visible in the PDF file as well.
However if you have made certain changes on the client side that is NOT submitted back to the server side, then when you click the "Test" button, those changes would be lost and when the page reloads in the browser, it would not reflect those changes. In this case if you call RenderAsPDF, those changes won't appear in the PDF file either. In another word, the same rule applies: If it doesn't show up in the browser when RenderAsPDF is not called, it won't show up in the PDF file when RenderAsPDF is called.
Hope this helps. Feel free to let us know if you still have problems.
Thanks!