Forums
This topic is locked
Automatic refresh in main Window?
Posted 16 May 2005 14:27:12
1
has voted
16 May 2005 14:27:12 Henrik Sandeberg posted:
I have a page where i push a button to delete a record, a popup whill show up with a question like, are you sure you want to delete this?If i push the yes button i want the record to be deleted and the window will close ( i have done this, and it works great but here comes my problem), When the window closes i want the main window to refresh (where i have my list of records), Anyone?
Replies
Replied 16 May 2005 23:56:21
16 May 2005 23:56:21 Rene Bandsma replied:
Interesting question... I want to know this also. Maybe this will help you:
javascriptkit.com/script/cut105.shtml;
dotnetjunkies.com/WebLog/dinakar/articles/12379.aspx;
Or: www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=javascript+remote+control
<hr><b>DMXZone support manager</b><br><a href="www.kousman.nl">Kousman web resellers</a>
javascriptkit.com/script/cut105.shtml;
dotnetjunkies.com/WebLog/dinakar/articles/12379.aspx;
Or: www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=javascript+remote+control
<hr><b>DMXZone support manager</b><br><a href="www.kousman.nl">Kousman web resellers</a>
Replied 17 May 2005 09:02:26
17 May 2005 09:02:26 Henrik Sandeberg replied:
I think i have solved it, but now its refreshing the page even if a press no, code below:
<pre id=code><font face=courier size=2 id=code>
<%@LANGUAGE="VBSCRIPT"%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> ""
Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> ""
Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> ""
Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> ""
Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> ""
Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<html>
<head>
<title>Fråga</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
a:hover { cursor: hand}
.verdana {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>
</head>
<body bgcolor="#FF0000" text="#000000" onUnload="javascript: opener.location='change.asp'"> <!-- opener.location -->
<p class="verdana" align="center">Är du säker på att du vill
ta bort posten?</p>
<table width="165" border="0" cellspacing="1" cellpadding="2" align="center">
<tr>
<td width="62" align="left"><A HREF="del.asp?<%= MM_keepURL %>"><img src="../img/buttons/ja.gif" width="50" height="20" border="0" onclick="javascript:window.close();"></A></td>
<td width="29"> </td>
<td width="58" align="right">
<div align="right"><a href="javascript:window.close();"><img src="../img/buttons/nej.gif" width="50" height="20" border="0"></a></div>
</td>
</tr>
</table>
<p class="verdana12b" align="center"> </p>
<p> </p>
</body>
</html>
</font id=code></pre id=code>
The page that refreshes is change.asp
I will work a little more on this, i dont want to have the page refreshed when i push the NO button, but it really doesnt matter, but....
Edited by - smalbenet on 17 May 2005 09:05:01
Edited by - smalbenet on 17 May 2005 09:05:51
<pre id=code><font face=courier size=2 id=code>
<%@LANGUAGE="VBSCRIPT"%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> ""

MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> ""

if (MM_keepURL <> ""

if (MM_keepForm <> ""

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> ""

MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<html>
<head>
<title>Fråga</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
a:hover { cursor: hand}
.verdana {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>
</head>
<body bgcolor="#FF0000" text="#000000" onUnload="javascript: opener.location='change.asp'"> <!-- opener.location -->
<p class="verdana" align="center">Är du säker på att du vill
ta bort posten?</p>
<table width="165" border="0" cellspacing="1" cellpadding="2" align="center">
<tr>
<td width="62" align="left"><A HREF="del.asp?<%= MM_keepURL %>"><img src="../img/buttons/ja.gif" width="50" height="20" border="0" onclick="javascript:window.close();"></A></td>
<td width="29"> </td>
<td width="58" align="right">
<div align="right"><a href="javascript:window.close();"><img src="../img/buttons/nej.gif" width="50" height="20" border="0"></a></div>
</td>
</tr>
</table>
<p class="verdana12b" align="center"> </p>
<p> </p>
</body>
</html>
</font id=code></pre id=code>
The page that refreshes is change.asp
I will work a little more on this, i dont want to have the page refreshed when i push the NO button, but it really doesnt matter, but....
Edited by - smalbenet on 17 May 2005 09:05:01
Edited by - smalbenet on 17 May 2005 09:05:51