Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Close pop window and refresh the parent window

Reply
Thread Tools

Close pop window and refresh the parent window

 
 
J P Singh
Guest
Posts: n/a
 
      02-05-2004
Hi Guys

Wonder if someone can help me with this.

I have a form where a user clicks a button which gives them a pop up windows
to allow them to add the data. The user adds the data and click save. The
pop window closes and refreshs the parent window to allow the entered data
to be displayed.

It was all working okay until couple of days back when it stopped.

Can someone offer any help. I have posted the relevant code here. Please let
me know if you need to see all code.

Thanks

Jas

<body bgcolor="#FFFFFF" text="#000000" onLoad =
"checkClose('<%=bCloseWindow%>')">

function checkClose(flagClose){
if(flagClose==1) {
window.opener.document.thisForm.action = "createExpense.asp"
window.opener.document.thisForm.htbAction.value = "edit"
window.opener.document.thisForm.htbMode.value = "edit"
window.opener.document.thisForm.submit()
self.close()
}


Sub AddExpense()
Dim Rs

GetPostData()
sql = "Insert into expenseDetails (ExpenseId, ExpenseDate, Type,"
sql = sql & "Amount, City, Notes, Receipt, Billable, Bartered,
BarteredDetails"
sql = sql & ") values ("
sql = sql & "'" & strExpenseId & "',"
sql = sql & "'" & strDate & "',"
sql = sql & "'" & strType & "',"
sql = sql & "'" & strAmount & "',"
sql = sql & "'" & strCity & "',"
sql = sql & "'" & strNotes & "',"
sql = sql & "'" & strReceipt & "',"
sql = sql & "'" & strBillable & "',"
sql = sql & "'" & strBarter & "',"
sql = sql & "'" & strBarterDetails & "x'"
sql = sql & ")"
Response.write sql
conn.execute sql
'Get the new detail id
sql = "Select Max(expenseDetailId) as ExpenseDetailId from expenseDetails
where expenseId = " & strExpenseId

set Rs = server.createobject("ADODB.recordset")
Rs.open Sql,conn,1,3
If not Rs.Eof Then
strDetailId = Rs("ExpenseDetailId")
If strBillable = "1" Then AddBillableExpense()
End If
bCloseWindow = "1"

End Sub


 
Reply With Quote
 
 
 
 
Alex Goodey
Guest
Posts: n/a
 
      02-05-2004
what does "stopped" mean?? do you get an error message? what exactly is the
problem?

"J P Singh" <noemail@asIhatespam> wrote in message
news:%23gbFb$(E-Mail Removed)...
> Hi Guys
>
> Wonder if someone can help me with this.
>
> I have a form where a user clicks a button which gives them a pop up

windows
> to allow them to add the data. The user adds the data and click save. The
> pop window closes and refreshs the parent window to allow the entered data
> to be displayed.
>
> It was all working okay until couple of days back when it stopped.
>
> Can someone offer any help. I have posted the relevant code here. Please

let
> me know if you need to see all code.
>
> Thanks
>
> Jas
>
> <body bgcolor="#FFFFFF" text="#000000" onLoad =
> "checkClose('<%=bCloseWindow%>')">
>
> function checkClose(flagClose){
> if(flagClose==1) {
> window.opener.document.thisForm.action = "createExpense.asp"
> window.opener.document.thisForm.htbAction.value = "edit"
> window.opener.document.thisForm.htbMode.value = "edit"
> window.opener.document.thisForm.submit()
> self.close()
> }
>
>
> Sub AddExpense()
> Dim Rs
>
> GetPostData()
> sql = "Insert into expenseDetails (ExpenseId, ExpenseDate, Type,"
> sql = sql & "Amount, City, Notes, Receipt, Billable, Bartered,
> BarteredDetails"
> sql = sql & ") values ("
> sql = sql & "'" & strExpenseId & "',"
> sql = sql & "'" & strDate & "',"
> sql = sql & "'" & strType & "',"
> sql = sql & "'" & strAmount & "',"
> sql = sql & "'" & strCity & "',"
> sql = sql & "'" & strNotes & "',"
> sql = sql & "'" & strReceipt & "',"
> sql = sql & "'" & strBillable & "',"
> sql = sql & "'" & strBarter & "',"
> sql = sql & "'" & strBarterDetails & "x'"
> sql = sql & ")"
> Response.write sql
> conn.execute sql
> 'Get the new detail id
> sql = "Select Max(expenseDetailId) as ExpenseDetailId from expenseDetails
> where expenseId = " & strExpenseId
>
> set Rs = server.createobject("ADODB.recordset")
> Rs.open Sql,conn,1,3
> If not Rs.Eof Then
> strDetailId = Rs("ExpenseDetailId")
> If strBillable = "1" Then AddBillableExpense()
> End If
> bCloseWindow = "1"
>
> End Sub
>
>



 
Reply With Quote
 
 
 
 
J P Singh
Guest
Posts: n/a
 
      02-05-2004
Sorry for not being clear enough.

What it does is it adds the data to the table but doesnot close the window.
I have to manually close the pop up window and then press F5 to refresh the
screen and the data i have entered shows up but I would want the pop up
window to close automatically with the back window refreshed.

Thanks

Jas

"Alex Goodey" <(E-Mail Removed)> wrote in message
news:bvt51m$102eg4$(E-Mail Removed)-berlin.de...
> what does "stopped" mean?? do you get an error message? what exactly is

the
> problem?
>
> "J P Singh" <noemail@asIhatespam> wrote in message
> news:%23gbFb$(E-Mail Removed)...
> > Hi Guys
> >
> > Wonder if someone can help me with this.
> >
> > I have a form where a user clicks a button which gives them a pop up

> windows
> > to allow them to add the data. The user adds the data and click save.

The
> > pop window closes and refreshs the parent window to allow the entered

data
> > to be displayed.
> >
> > It was all working okay until couple of days back when it stopped.
> >
> > Can someone offer any help. I have posted the relevant code here. Please

> let
> > me know if you need to see all code.
> >
> > Thanks
> >
> > Jas
> >
> > <body bgcolor="#FFFFFF" text="#000000" onLoad =
> > "checkClose('<%=bCloseWindow%>')">
> >
> > function checkClose(flagClose){
> > if(flagClose==1) {
> > window.opener.document.thisForm.action = "createExpense.asp"
> > window.opener.document.thisForm.htbAction.value = "edit"
> > window.opener.document.thisForm.htbMode.value = "edit"
> > window.opener.document.thisForm.submit()
> > self.close()
> > }
> >
> >
> > Sub AddExpense()
> > Dim Rs
> >
> > GetPostData()
> > sql = "Insert into expenseDetails (ExpenseId, ExpenseDate, Type,"
> > sql = sql & "Amount, City, Notes, Receipt, Billable, Bartered,
> > BarteredDetails"
> > sql = sql & ") values ("
> > sql = sql & "'" & strExpenseId & "',"
> > sql = sql & "'" & strDate & "',"
> > sql = sql & "'" & strType & "',"
> > sql = sql & "'" & strAmount & "',"
> > sql = sql & "'" & strCity & "',"
> > sql = sql & "'" & strNotes & "',"
> > sql = sql & "'" & strReceipt & "',"
> > sql = sql & "'" & strBillable & "',"
> > sql = sql & "'" & strBarter & "',"
> > sql = sql & "'" & strBarterDetails & "x'"
> > sql = sql & ")"
> > Response.write sql
> > conn.execute sql
> > 'Get the new detail id
> > sql = "Select Max(expenseDetailId) as ExpenseDetailId from

expenseDetails
> > where expenseId = " & strExpenseId
> >
> > set Rs = server.createobject("ADODB.recordset")
> > Rs.open Sql,conn,1,3
> > If not Rs.Eof Then
> > strDetailId = Rs("ExpenseDetailId")
> > If strBillable = "1" Then AddBillableExpense()
> > End If
> > bCloseWindow = "1"
> >
> > End Sub
> >
> >

>
>



 
Reply With Quote
 
Howard Rothenburg
Guest
Posts: n/a
 
      02-11-2004
You can use the following to refresh the parent window and close the current window:

<script language="JavaScript">
<!--
function refreshParent()
{
window.opener.location.href = window.opener.location.href;
window.close();
}
//-->
</script>



"J P Singh" <noemail@asIhatespam> wrote in message news:<(E-Mail Removed)>...
> Sorry for not being clear enough.
>
> What it does is it adds the data to the table but doesnot close the window.
> I have to manually close the pop up window and then press F5 to refresh the
> screen and the data i have entered shows up but I would want the pop up
> window to close automatically with the back window refreshed.
>
> Thanks
>
> Jas
>
> "Alex Goodey" <(E-Mail Removed)> wrote in message
> news:bvt51m$102eg4$(E-Mail Removed)-berlin.de...
> > what does "stopped" mean?? do you get an error message? what exactly is

> the
> > problem?
> >
> > "J P Singh" <noemail@asIhatespam> wrote in message
> > news:%23gbFb$(E-Mail Removed)...
> > > Hi Guys
> > >
> > > Wonder if someone can help me with this.
> > >
> > > I have a form where a user clicks a button which gives them a pop up

> windows
> > > to allow them to add the data. The user adds the data and click save.

> The
> > > pop window closes and refreshs the parent window to allow the entered

> data
> > > to be displayed.
> > >
> > > It was all working okay until couple of days back when it stopped.
> > >
> > > Can someone offer any help. I have posted the relevant code here. Please

> let
> > > me know if you need to see all code.
> > >
> > > Thanks
> > >
> > > Jas
> > >
> > > <body bgcolor="#FFFFFF" text="#000000" onLoad =
> > > "checkClose('<%=bCloseWindow%>')">
> > >
> > > function checkClose(flagClose){
> > > if(flagClose==1) {
> > > window.opener.document.thisForm.action = "createExpense.asp"
> > > window.opener.document.thisForm.htbAction.value = "edit"
> > > window.opener.document.thisForm.htbMode.value = "edit"
> > > window.opener.document.thisForm.submit()
> > > self.close()
> > > }
> > >
> > >
> > > Sub AddExpense()
> > > Dim Rs
> > >
> > > GetPostData()
> > > sql = "Insert into expenseDetails (ExpenseId, ExpenseDate, Type,"
> > > sql = sql & "Amount, City, Notes, Receipt, Billable, Bartered,
> > > BarteredDetails"
> > > sql = sql & ") values ("
> > > sql = sql & "'" & strExpenseId & "',"
> > > sql = sql & "'" & strDate & "',"
> > > sql = sql & "'" & strType & "',"
> > > sql = sql & "'" & strAmount & "',"
> > > sql = sql & "'" & strCity & "',"
> > > sql = sql & "'" & strNotes & "',"
> > > sql = sql & "'" & strReceipt & "',"
> > > sql = sql & "'" & strBillable & "',"
> > > sql = sql & "'" & strBarter & "',"
> > > sql = sql & "'" & strBarterDetails & "x'"
> > > sql = sql & ")"
> > > Response.write sql
> > > conn.execute sql
> > > 'Get the new detail id
> > > sql = "Select Max(expenseDetailId) as ExpenseDetailId from

> expenseDetails
> > > where expenseId = " & strExpenseId
> > >
> > > set Rs = server.createobject("ADODB.recordset")
> > > Rs.open Sql,conn,1,3
> > > If not Rs.Eof Then
> > > strDetailId = Rs("ExpenseDetailId")
> > > If strBillable = "1" Then AddBillableExpense()
> > > End If
> > > bCloseWindow = "1"
> > >
> > > End Sub
> > >
> > >

> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
refresh parent window on close showModalDialog? Simon Storr ASP .Net 5 07-23-2012 05:35 AM
Close Pop-up window and reload parent page vseshan204 ASP .Net 3 07-27-2009 07:57 AM
beginner: how to close a pop up window before opening an other pop up Madame Blablavatsky Javascript 8 09-16-2005 10:27 PM
how to get pop-up to link (and then close) to NON PARENT window??? DROdio Javascript 1 07-20-2003 10:58 AM
Re: Refresh of parent window from pop up child causes a problem Natty Gur ASP .Net 0 07-01-2003 06:08 AM



Advertisments