Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15

Thread: Popup

  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Popup

    This is probably really simple and I must just be having a mental block, my code follows.

    if not rtrim(RecSet.Fields.Item("cont_email").Value) = "" then

    MySmartMailz.SendMail
    else
    response.Redirect("addemail.asp?type=close&lognumber=" & lognumber)
    end if
    I want that redirect to be a popup instead into a new small window!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm, I don't know what you mean by "I want that redirect to be a popup instead into a new small window!".

    Can you rephrase that?
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #3
    Regular Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So instead of bouncing the current window to a new location I want a similar thing to a JS popup but don't really know how to call within my asp.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just write out some js.

    else
    Response.Write("<script language='Javascript'>window.open('addemail.asp?type=close&lognumber=" & lognumber & "','','width=400,height=400')</script>")
    end if


    This syntax many not be correct but you get the idea

  • #5
    Regular Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So this is how I can write JS in ASP?

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So this is how I can write JS in ASP?
    This is how you can write out client side js with your server side variables(ASP). So the answer is yes as long as you know that none of the js is functional on the server just client.

    PS. This is off topic but did anyone know if you hold down the ctl button and move you mouse wheel it is a shortcut for increasing or decreasing the screen font size. This always happens to me on this forum and just today I figured out why.

  • #7
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Originally posted by allida77
    PS. This is off topic but did anyone know if you hold down the ctl button and move you mouse wheel it is a shortcut for increasing or decreasing the screen font size. This always happens to me on this forum and just today I figured out why.
    You also can hold down shift when you click on a link it will open it in a new window.

  • #8
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    You can hit "Ctrl" + "Alt" + "Delete" at the same time, to fix many Window's caused problems!

    <edit>
    If you can open a popup window with JS, can you use VBscript to do it too?
    </edit>

  • #9
    Regular Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If I use the code allida put it won't pop-up. But if I put my response.redirect in it does the redirect.????

  • #10
    Regular Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think I just figured something, now for the purposes of the page that bit of code is outside the <html> tags.

    I have tried setting in place of the response.redirect a strvariable = "true" then later inside the <html> and in the head adding <% if strvariable = true then %> adding the code that allida posted.

  • #11
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You might want to look up a couple examples of Subroutines I've posted - basically, depending upon whatever logic you want, you can display completely different HTML (or client-side javascript) - for instance in this case, including code to popup a window.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #12
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have tried setting in place of the response.redirect a strvariable = "true" then later inside the <html> and in the head adding <% if strvariable = true then %> adding the code that allida posted.
    That is correct. Did you get it working?

  • #13
    Regular Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No I didn't allida, it was puzzling me!

  • #14
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <%@ Language=VBScript%>
    <%Option Explicit%>
    <%
    Dim strOpenWin
    '** Your logic will go here for brevity I left it out.
    strOpenWin="<script Language=""Javascript"">OpenWin('http://www.google.com',300,200);</script>"
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <script language="Javascript">
    //just my open win function there are million out there so feel free to use whatever open function you want
    function OpenWin(W,wth,hgt) {
    	LeftPosition = (screen.width) ? (screen.width-wth)/2 : 0;
    	TopPosition = (screen.height) ? (screen.height-hgt)/2 : 0;
    	mywindow=open(W,'myname','height=' + hgt + ',width= ' + wth + ',left=' + LeftPosition + ',top=' + TopPosition + ',resizable=no');
    	mywindow.location.href = W;
    	if (mywindow.opener == null) mywindow.opener = self;	
    }
    </script>
    </HEAD>
    
    <BODY>
    <!--  Write Out variable to Open Window-->
    <%=strOpenWin%>
    </BODY>
    </HTML>

  • #15
    Regular Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Allida, that worked alot better!


  •  

    Posting Permissions

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