This page has moved. You will be automatically redirected to its new location in 10 seconds. If you aren't forwarded to the new page, click here.

Search This Blog

Friday, February 27, 2009

Open a PDF file using VB.NET in an UpdatePanel

After hours of trying n searching, i finally got it done by the following way:
Use a trigger for UpdatePanel on the button
Register your client side script in the button click even
Sample Code:

(ASCX)
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<triggers>
<asp:postbacktrigger controlid="btnSubmit" />
</triggers>
<ContentTemplate>
(ASCX.CS)
Dim strscriptMF As String
strscriptMF = "<script language=javascript>window.open('" & pdfPathMF & "')</script>"
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "strScriptMF", strscriptMF)

Reference:

http://forums.asp.net/p/1082431/1605489.aspx#1605489

No comments:

Post a Comment