Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include/Call an asp.net page within Classic asp page

Status
Not open for further replies.

bluecjh

Programmer
Mar 12, 2003
385
How can you:
Include/Call an asp.net page within a classic asp page

I tried using an <iframe> but although the .net page seems
to load within the classic asp page(it appears as a blank frame) the code(in the .net)
doesn't seem to work (it's supposed to make a database
connection and insert a record)

Thanks for any help.

BlueCJH
 
I'm not sure what you mean dave?

BlueCJH
 
well unless you are using url paremeters or form objects the asp.net and asp classic page will not interact, so i was wondering if you run the .net page outside of the iframe does it do what you expect it to?

}...the bane of my life!
 
If I run the .net page stand alone it works.

Here's what i'm trying:

1st asp page

Code:
<%@ language=JavaScript %>
<!-- #include virtual="/navigation/APSInfoLink.asp" -->
<%
...

2nd asp page (APSInfoLink.asp)

Code:
<iframe src="APSInfotest.aspx"></iframe>
<%
{
...
}
%>


3rd asp page (the bit that does not run)

Code:
<%@ Page Language="VB" Debug="True" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">

Sub Page_Load

...

	        	connHits = New SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ReportsUsage;Data Source=HG033")
	        	connHits.Open()

			cmdSelect = New SqlCommand( "INSERT INTO tblUsage (UserName, ReportName) VALUES ('" & mstrUserId1 & "','" & AspPage & "')", connHits)
			dtrReader = cmdSelect.ExecuteReader()
...
End Sub
</script>


The frame appears on the page but the code does not take effect.

thanks


BlueCJH
 
Dave,
As I see the .net and classic pages don't have to interact
the .net page code must just run.

BlueCJH
 
OK my mistake my <iframe src="APSInfotest.aspx"></iframe>

should have been

<iframe src="/.../APSInfotest.aspx"></iframe>

there just happened to be an old file
sitting around in the same directory I'm sorry to waste
your time Dave (and mine)

Thanks for your input

BlueCJH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top