Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Working with ASP pages across frames


Message #1 by "Christopher Cote" <chrscote@9...> on Wed, 15 Jan 2003 17:48:37
I am working on a project in which I need to have an editable section and 
a display section.  My project leader wants to use 2 frames so the users 
won't have to scroll to find the edit section.  When someone submits 
changes to the edit section, the display section is to update with that 
data.  Also, when someone clicks in the display section, a value is sent 
to the edit segment to display what is currently selected for them to 
change.  Is there anything special that needs to be done to talk between 
frames and if so, does anyone know of a site that has some examples or 
description of what needs to be done?

Chris
Message #2 by sashi@a... on Thu, 16 Jan 2003 11:56:32
U solved Ur problem?or shall i send  sample files on frames
Message #3 by "Christopher Cote" <chrscote@9...> on Thu, 16 Jan 2003 15:43:43
I haven't solved my entire problem yet.  I'm still not sure how to use a 
database connection across 2 frames.  Both frames in my page need to have 
database connection which use different things to load their respective 
pages. 

Chris
Message #4 by "sashi dhar" <sashi@a...> on Fri, 17 Jan 2003 02:03:33 -0500
here is the sample program of frames
there are three 3 files
1) frame.htm
2)first.asp
3)second.asp
u have to run the frame.htm
which will call within both asp pages

--------------frame.htm-------------------------------------------------
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<frameset cols="50%,*" border=5>
<frame  name=f1 src="first.asp">
</frame>
<frame name=f2 src="second.asp">
</frame>
</frameset>
</HTML>
________________________________________________________________________

----------------------------first.asp----------------------------------

<%@ Language=VBScript %>
<%

dim con,rs,sql

set con=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
'create table login in access
'with fields
'uid as text
'pwd as text
 
'create DSN 'hello'

con.Open "hello"  
rs.Open "select uid from login",con

'con.Execute "insert into login values('abc','xyz') "
'Response.Write "data inserted"

%>
<META content="MSHTML 5.50.4134.600" name=GENERATOR></HEAD>
<BODY>

<form action="second.asp" method=post target=f2>

select uid : <SELECT style="WIDTH: 126px" name=uid> 
<%
while not rs.EOF 
%>
<OPTION selected value="<%=rs.Fields("uid")%>"><%=rs.Fields("uid")%></OPTION>
<%
rs.MoveNext 
wend
%>

</SELECT>&nbsp;<INPUT type=submit value=Submit>
</form>
</BODY></HTML>

____________________________________________________________________________

-------------------------------second.asp----------------------------------

<%@ Language=VBScript %>
<%

dim con,rs,sql
if Request.Form("uid")<>"" then 
uid=Request.Form("uid") 
set con=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
'create table login in access
'with fields
'uid as text
'pwd as text
 
'create DSN 'hello'

con.Open "hello"

sql="select pwd from login where uid='"+uid+"'"  
rs.Open sql,con

'con.Execute "insert into login values('abc','xyz') "
'Response.Write "data inserted"

Response.Write "uid="
Response.Write uid
Response.Write "<br>" 
Response.Write "password="
Response.Write rs.Fields("pwd") 

end if
%>

__________________________________________________________________________

the flow is like that uses will select the userid from first.asp in first frame and
in second.asp will show the related password in secon frame

Hope this sample helps u
-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Meet Singles
http://corp.mail.com/lavalife


  Return to Index