How do I iterate the datareader in a child window and return the values to the parent

srithil

Newcomer
Joined
Apr 30, 2004
Messages
21
Hai I am new to asp.net.

I am opening a child window by a popup.I trigger an event by a buttonnext,I make a database connection and select records and store it in my datareader .I try to pass the values through the window.opener method to the parent window.How do I iterate the values in the datareader when i press the button again.when i press the button again the parent fields has to be populated with the new record values.Here is my code.
Also i am not able to pass the value for a checkbox.how do i pass a value to the checkbox if i am storing as true or false in the database,so that the checkbox gets checked in my parent window.

Anybody please help.I am stuck with this.
tx




child.aspx
----------

sub buttonnext(sender as object,e as eventargs)

sql1 = "SELECT * FROM Nt_site_contact ------
connections go on here........

mydr1 as datareader
mydr1.read()

str = "<script language=JavaScript>"

str += "window.opener.partform.p_site_code.value='" & mydr1("site_id")"';
str += "window.opener.partform.p_active.checked = '" & mydr1("active") "';"
str += "<"
str += "/script>"

If(Not Page.IsStartupScriptRegistered("any")) Then
Page.RegisterStartupScript("any", str)
End If
myconn.close
end sub
-------------------------------------------------------------------------------------------------------------------
parent.aspx


sub findbutton(Sender as Object,e as eventargs)
Dim str as string
str="<script language='JavaScript'>window.open('child.aspx','PopUp','location=no,height=120px,width=400px,toolbar

=no,status=no,menubar=no,scrollbars=no,resizable=no')<"&"/script>"

If (Not Page.IsStartupScriptRegistered("clientScript")) Then
Page.RegisterStartupScript("clientScript",str)
End If

end sub
 
Back
Top