troubleshooting Question

How to close browser in aspx.vb page

Avatar of hannsmedia
hannsmediaFlag for Singapore asked on
.NET ProgrammingVisual Basic.NET
4 Comments1 Solution1044 ViewsLast Modified:
Hi. I am having problem to close a browser. I will execute Schedule_AutoBill.vbs which then will open a browser and go to GetAdvDetailWS.aspx. How do I close the browser in my .aspx.vb file?

Schedule_AutoBill.vbs
Set WshShell = WScript.CreateObject("WScript.Shell") 
RunWeb = WshShell.Run("http://nothern/ws/GetADvDetailWS/GetAdvDetailWS.aspx?custID=CU0&successLink=", 1) 

GetAdvDetailWS.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="GetAdvDetailWS.aspx.vb" Inherits="_Default" Debug="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>GetAdvDetailWS</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <%
        Dim custID As String = Request("custID")
        Dim successLink As String = Request("successLink")
       
        Call GetAdvDetailWS(custID, successLink)
    %>
    
    </div>
    </form>
</body>
</html>

GetAdvDetailWS.aspx.vb
Imports System.Data
Imports System.Data.SqlClient
Partial Class _Default
    Inherits System.Web.UI.Page
    Sub GetAdvDetailWS(ByVal custIDList, ByVal successLink)
        If len(successLink) > 0 Then
            Response.Redirect("http://google.com")
        Else
            Response.Write("<script language='text/javascript'>window.close();</script>")
        End If
    End Sub
ASKER CERTIFIED SOLUTION
hannsmedia

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros