open multiple new pages within a DataReader

B

bdwgarth

I am trying to open a new web page for each item returned by the
DataReader. I am using JavaScript to open each new window, and using a
session variable to pass the DataReader Item value to the newly created
page. The problem I am running into is all the pages are opening with
the same value, which is the last item returned by the DataReader.
Here is my code:

Session("BatchNumber") = sqldr.Item("q_Batch")
Response.Write("<script
language=javascript>window.open('PrintREs.aspx');</script>")

Any suggestions?

Thank You!!
 
K

Karl Seguin

there's only 1 batchNumber value and you keep overwriting it...by the time
the other pages have loaded, Session("BatchNumber") is probably equal to the
last q_batch value in your datareader.

why not just do:

string.Format("PrintREs.aspx?id={0}", sqldr.Item("q_Batch");

?

Karl
 
B

bdwgarth

Do you put this within the javascript window.open tag. I have tried
this but does not cause any pages to open, both in the window.open and
stand alone. ???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top