Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.Net VB call JavaScript function from Code Behind

I have a function that is responsible for populating an SSRS report. The user presses a button and I go out and check to see if there is data. If no data, I provide a NO DATA message. If there is data I call the SSRS report which I would like to open in a new window. I thought using a JavaScript function would be the best way to accomplish this. How is this done or what would you recommend? Thanks in advance!

    <script type="text/javascript">
        function openWindow(url) {
            document.forms[0].target = "_blank";
        }
    </script>
like image 312
Susan Avatar asked Feb 10 '12 21:02

Susan


1 Answers

Try this:

 System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "Script", "openWindow(url);", True)
like image 199
coder Avatar answered Sep 21 '22 01:09

coder