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>
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>
&lt;%@LANGUAGE="VBSCRIPT"%&gt;
&lt;%
' *** 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 &lt;&gt; "" 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 &lt;&gt; "" Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL &lt;&gt; "" Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm &lt;&gt; "" 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 &lt;&gt; "" Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Fråga&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;style type="text/css"&gt;
&lt;!--
a:hover { cursor: hand}
.verdana {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body bgcolor="#FF0000" text="#000000" onUnload="javascript: opener.location='change.asp'"&gt; &lt;!-- opener.location --&gt;
&lt;p class="verdana" align="center"&gt;Är du säker på att du vill
ta bort posten?&lt;/p&gt;
&lt;table width="165" border="0" cellspacing="1" cellpadding="2" align="center"&gt;
&lt;tr&gt;
&lt;td width="62" align="left"&gt;&lt;A HREF="del.asp?&lt;%= MM_keepURL %&gt;"&gt;&lt;img src="../img/buttons/ja.gif" width="50" height="20" border="0" onclick="javascript:window.close();"&gt;&lt;/A&gt;&lt;/td&gt;
&lt;td width="29"&gt; &lt;/td&gt;
&lt;td width="58" align="right"&gt;
&lt;div align="right"&gt;&lt;a href="javascript:window.close();"&gt;&lt;img src="../img/buttons/nej.gif" width="50" height="20" border="0"&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p class="verdana12b" align="center"&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;

</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

Reply to this topic