Results 1 to 4 of 4

Thread: javascript/asp, cant close the page properly

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    javascript/asp, cant close the page properly

    I want to close a page if the user doesnt include the query string. this code kinda works, the problem is that when the javascrpit code runs, IE shows me a dialogbox telling me that the page is trying to close itself. and then it asks me if I want to close it or not. But I want the code to close the window automatically, what's wrong with this:

    VB Code:
    1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         Dim entryID As String = Request.QueryString.Item("entryID")
    3.         If entryID Is Nothing Then
    4.             Response.Write("<script>setTimeout(""self.close()"",1);</script>")
    5.         End If
    6.     End Sub
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    if the Page that is open has been opened with javascript (window.open) then you will not get prompted, otherwise, you do

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    aha thanks... here's how I use javascript
    I open dreamweaver, add some events/stuff, copy paste/modify the code and use it on my page I'm really an idiot haha, gotto learn java script.... you think I should just look around at some online guides? or should I buy a book?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    If I need a quick answer to something I tend to just search forums or google but when I'm learning something new I always buy a book (normally a dummies book!).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width