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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embed without using IFrame?

Status
Not open for further replies.

elhaix

Programmer
Jul 31, 2006
115
CA

Hi gang,

We've got a reusable html tool, normally referenced on several websites through an IFrame, to follow the workflow through HTML.

I'd like to NOT use the IFrame, but still enable these sites to use this tool.

This is done in .Net, so I'm looking for some alternate solutions.


Thank you.
 

One solution is to embed an external JS file:
index.html:
Code:
<html>
<head>

</head>
<body>
	<h1>Testing Embed</h1>
	<script type="text/javascript" src="jsEmbedTest.js"></script>
</body>
</html>

jsEmbedTest.js:

Code:
document.write('<h2>Testing this out...</h3><a href="test.html">Click here</a>');

But this does not solve the problem, as when you view the page source, you don't see the document.write portion, containing "Testing this out...".

As I mentioned, this is being done in .Net - any suggestions are appreciated.


 
Can you utilize user controls? If so, you put together your html tool in a usercontrol, then you can reference it and drag it onto any .NET page you like or dynamically load it into a placeholder in the code behind.

dynamic load example:
aspx-
Code:
<%@ Reference Control="~/UserControlName.ascx" %>

<asp:PlaceHolder ID="PlaceHolderID" runat="server"></asp:PlaceHolder>

code behind-
Code:
UserControlName myUserControl= (UserControlName)Page.LoadControl("UserControlName.ascx");
                    PlaceHolderID.Controls.Add(myUserControl);

Good Luck!

.mark.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top