By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,534 Members | 1,830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,534 IT Pros & Developers. It's quick & easy.

Opening an apsx page in new window and redireting the opening page as well

P: 1
I have a apsx form (Form A), which on submiting does a time consuming task. So i want to open a new aspx window (Form B) in which I want do do that time consuming task and show progress to the user and while that task is being completed I want Form A to redirect to Form C.

I opened form B in a new javascript window and updated the progress through ajax but Form A doesn't let me redirect to Form C unless Form B's processing is Completed.

Here's the code:-

This is how I am opening a new window (Form B) from Form A (ParentForm.aspx).

ParentForm.aspx

function openWindow()
{
window.open("http://localhost/TreeViewCheck03/BusyForm.aspx",
"mywindow","width=400,height=400");
}

<form id="Form1" method="post" runat="server">

<asp:TextBox runat="Server" ID="txtBox"/>
<input type="button" onclick="openWindow();" Value="Start Processing"/>
<asp:Button Id="btnHomePage" runat="Server" text="HomePage"/>

</form>



ParentForm.aspx.vb

Private Sub btnHomePage_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnHomePage.Click
Response.Redirect("http://www.google.com")
End Sub



This is the code in Form B (BusyForm.aspx) which runs indefinitely.

BusyForm.aspx.vb

Private Sub CallDbProc()
Dim szSQL As String
Dim i, rcount As Integer
Dim conn As SqlConnection
Dim sqlcmd As SqlCommand
Dim sdataAdapter As SqlDataAdapter
Dim ds As DataSet
Dim bLoop As Boolean

conn = New SqlConnection("server=my-dev02;database=myDB;uid=sa;pwd=sqlsa")
bLoop = True



'This loop ends when an entry is made into a table from some other application
While bLoop
szSQL = "zSProc_TestValue"
sdataAdapter = New SqlDataAdapter(szSQL, conn)
sdataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure

ds = New DataSet
sdataAdapter.Fill(ds)

If Not IsNothing(ds) Then
For rcount = 0 To ds.Tables(0).Rows.Count - 1
If ds.Tables(0).Rows(0)(0) > 0 Then
bLoop = False
End If
Next
End If
End While

End Sub


The problem is once I've clicked on the start processing button (and BusyForm has opened in a new window) when I click

on 'btnHomePage' button it doesn't take redirect me to any other page (say google) untill BusyForm completes processing.

I hope I 've made the problem clear. Please feel free to ask if I haven't been able to explain something clearly.

Any help will be really appreciated.

Thanks.
Oct 5 '07 #1
Share this Question
Share on Google+
1 Reply


kenobewan
Expert 2.5K+
P: 4,871
Not sure about the design, but you can redirect the parent window using JS. HTH.
Oct 5 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.