Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Well what I am doing is opening a window with code executing behind it when it opens up. I would like to close the window once this code has finshed executing. Below is the .aspx.vb

 

Public Class DeleteAppointment
   Inherits System.Web.UI.Page
   Dim iAppointmentID As Integer
   Dim sAppointmentType As String
#Region " Web Form Designer Generated Code "

   'This call is required by the Web Form Designer.
   <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

   End Sub

   Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
       'CODEGEN: This method call is required by the Web Form Designer
       'Do not modify it using the code editor.
       InitializeComponent()
   End Sub

#End Region

   Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       'Put user code to initialize the page here
       iAppointmentID = Page.Request.QueryString("Appointment_ID")
       sAppointmentType = Page.Request.QueryString("Type")
       DeleteAppointment()
'**** I WOULD LIKE TO CLOSE THE WINDOW HERE *********
   End Sub
   Private Sub DeleteAppointment()
       Dim oDBHandler As New DBHandler()
       Dim sSql As String
       sSql = "Delete from [" & sAppointmentType & "] where appointment_id =" & iAppointmentID
       If oDBHandler.Connect = True Then
           If oDBHandler.ExecuteSQLCommand(sSql) = False Then
               'error
           End If
           oDBHandler.EndConnection()
       Else
           'error connecting
       End If
       oDBHandler = Nothing
   End Sub
End Class

  • *Gurus*
Posted

I don't understand why you'd want to do things like this, but I don't really need to know, do I? :)

 

Forget about the code-behind and add the following to the ASP.NET page itself:

 

<html>
   <head>
       <title>Demo</title>
   </head>
   <body onload="window.close()">
   </body>
</html>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...