koscek hmm
|
| Posted: 09/01/2005, 1:34 AM |
|
how can i make pop-up window in asp?
and retrieve my MS Access database into the pop-up
when i click "lejer" button in 1st page will go to 2nd page and display additional info of 1st page (1st & 2nd page R retrieve from database). how?
1st page

2d page (pop-up window)

also use client side scripting such as JavaScript
In the <head> of 1st page add the following:-
<script language="JavaScript" type="text/javascript">
<!--
function openWin(id) {
var uri = "page2,asp?id=" + id;
var newWin = window.open(uri,'newwindow','toolbar=0,location=0, status= 0,menubar=0,scrollbars=1,resizable=1,width=450,hei ght=250');
}
//-->
</script>
lejer button add the following:-
<input type="button" value="lejer" onclick="JavaScript:openWin(id)" />
OR
<input type="button" value="lejer" onclick="JavaScript:openWin(<%=objRS.Fields("icno").Value%>)" />
help me solve it
|
|
|
 |
Edd
Posts: 547
|
| Posted: 09/01/2005, 7:16 AM |
|
First try and build reusable functions is Javascript:
<script language="JavaScript" type="text/javascript">
function openWin(id) {
var uri = "page2.asp?id=" + id;
// you had a comma between page2 and asp
PopWin(uri ,400, 400, 30,120); // Height , with, etc are optional
}
function PopWin(windowName, aWidth, aHeight, aTop, aLeft)
{
var nW;
var nTop;
var nLeft;
var nWidth;
var nHeight;
nTop = 100;
if (aTop >= 0)
{
nTop = aTop;
}
nLeft = 120;
if (aLeft >= 0)
{
nLeft = aLeft;
}
nHeight = 420;
if (aHeight >= 0)
{
nHeight = aHeight;
}
nWidth = 650;
if (aWidth >= 0)
{
nWidth = aWidth;
}
nW = window.open("", "popup", "resizable=yes,scrollbars=yes,top=" + nTop.toString() + ",left=" + nLeft.toString() + ",width=" + nWidth.toString() + ",height=" + nHeight.toString() );
nW.location.href = windowName;
nW = null;
}
</script>
Your button should be
<input type="button" value="lejer" onclick="openWin(id);" />
Hope that helps
Edd
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
 |
 |
DonB
|
| Posted: 09/01/2005, 9:00 AM |
|
Follow Edd's instructions, but be aware you cannot generate a popup from the
server side - only on the browser. So, you must convey information to the
browser (such as a hidden form field or a URL parameter) to indicate the
browser should open a popup.
One other good way to do this is to put a Label on the page, and insert
javascript that pops-up whatever you want to have appear. This means
loading the Label with a complete <SCRIPT>...<./SCRIPT> block with all the
javascript (like Edd provided) to do the appropriate window open when the
label is displayed..
--
DonB
http://www.gotodon.com/ccbth
<koscekhmm@forum.codecharge (koscek hmm)> wrote in message
news:64316bd1750d02@news.codecharge.com...
> how can i make pop-up window in asp?
>
> and retrieve my MS Access database into the pop-up
>
> when i click "lejer" button in 1st page will go to 2nd page and display
> additional info of 1st page (1st & 2nd page R retrieve from database).
how?
>
> 1st page
> 
>
> 2d page (pop-up window)
> 
>
> also use client side scripting such as JavaScript
>
> In the <head> of 1st page add the following:-
>
> <script language="JavaScript" type="text/javascript">
> <!--
> function openWin(id) {
> var uri = "page2,asp?id=" + id;
> var newWin = window.open(uri,'newwindow','toolbar=0,location=0, status=
> 0,menubar=0,scrollbars=1,resizable=1,width=450,hei ght=250');
> }
> //-->
> </script>
>
>
> lejer button add the following:-
>
> <input type="button" value="lejer" onclick="JavaScript:openWin(id)" />
>
> OR
>
> <input type="button" value="lejer"
> onclick="JavaScript:openWin(<%=objRS.Fields("icno").Value%>)" />
>
>
> help me solve it
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|