...

View Full Version : Popup



Leeus
02-01-2003, 04:57 PM
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!

whammy
02-01-2003, 07:14 PM
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?

Leeus
02-01-2003, 07:17 PM
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.

allida77
02-01-2003, 07:58 PM
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

Leeus
02-01-2003, 08:31 PM
So this is how I can write JS in ASP?

allida77
02-01-2003, 08:47 PM
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.:D

oracleguy
02-01-2003, 11:06 PM
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.:D

You also can hold down shift when you click on a link it will open it in a new window.

Morgoth
02-02-2003, 05:34 AM
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>

Leeus
02-02-2003, 12:18 PM
If I use the code allida put it won't pop-up. But if I put my response.redirect in it does the redirect.????

Leeus
02-02-2003, 12:57 PM
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.

whammy
02-02-2003, 04:14 PM
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. :)

allida77
02-02-2003, 05:58 PM
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?

Leeus
02-03-2003, 08:17 AM
No I didn't allida, it was puzzling me!

allida77
02-03-2003, 02:29 PM
<%@ 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>

Leeus
02-04-2003, 08:53 AM
Thanks Allida, that worked alot better!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum