我如何嵌入一个ASP.NET网站(或Web应用程序)到另一个? [英] How do I embed an ASP.NET Web Site (or Web Application) into another?

查看:163
本文介绍了我如何嵌入一个ASP.NET网站(或Web应用程序)到另一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有ASP.NET经验非常少,我做了一些自我训练开始之前,我写我的第一个网站/应用程序,这将是一个校准实用程序。如何该实用程序的工作原理是不是我关心现在。然而,该实用程序最终需要结束嵌入在别人的网站,或者只是作为一个网址的页面与我的code或嵌入的(比如,作为一个HTML框架或iframe中)。为了弄清楚这个基础,我codeD了两个非常简单的ASP.NET网站,一个父,其中包含了框架,和一个孩子,这我试图投入帧中的一个。

I have very little experience with ASP.NET and I am doing some self-training before I start writing my first web site/application, which will be a calibration utility. How that utility works is not my concern right now. However, the utility eventually needs to end up embedded in someone else's web site, either just as a URL to the page with my code, or embedded (say, as an HTML frame or an iframe). To figure out the basics of this, I coded up two very simple ASP.NET web sites, a "parent" which contains the frameset, and a "child" which I am trying to put into one of the frames.

母公司的Default.aspx的HTML code基本上是这样的:

The parent's "Default.aspx" HTML code is basically this:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Parent Site Test 1</title>
</head>

<frameset cols="300,*">
    <frame name="outer" src="parent.aspx" noresize></frame>
    <frame name="inner" src="[what do I put here?]"</frame>
</frameset>

</html>

在parent.aspx页面只有最基本的HTML中的:

The "parent.aspx" page has only the most basic HTML in it:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        I am the parent web form.
    </div>
    </form>
</body>
</html>

子网站(因为我有现在)住在一间单独的VS2008的解决方案,为这项工作的目的,因为我试图重现在别人的网站必须引用我的校准网页的条件/网站/事情。我本来想会有一些方法来整个儿打包成一个DLL,然后会有一些方法来告诉家长使用该DLL作为源的子框架。这来自于我在Java世界中体验 - 使用JBoss和J2EE,这将迎刃而解,因为孩子也只是部署为其他EAR文件

The child web site (as I have it now) lives in a separate VS2008 solution, for the purposes of this exercise, because I am trying to reproduce the conditions in which someone else's web site has to reference my calibration web page/site/thing. I was originally thinking there would be some way to package the entire child into a single DLL, and then there would be some way to tell the parent to use that DLL as the source for the child frame. This comes from my experience in the Java world - using JBoss and J2EE, this would be easily solved because the child would just be deployed as another EAR file.

正与VS2008和ASP.NET完全没有经验,我花了相当谷歌几个小时,在过去几天里试图寻找一个答案,但没有成功。

Being completely inexperienced with VS2008 and ASP.NET, I spent quite a few hours on Google over the past few days trying to find an answer, to no avail.


  • 是我想要做的合理的;它是思考解决问题的正确方法?

  • Is what I'm trying to do reasonable; is it the right way to think about solving the problem?

我可以部署的孩子作为一个相对独立的自助式网站(或Web应用程序...我还不清楚的差异)通过某种方式包装成一个单一的DLL?如果是的话,那我怎么实际创建从我的网站/应用程序在VS2008这个DLL,而且我怎么那么引用它在父网站?

Can I deploy the child as a fairly independent and self-contained web site (or web application... I'm still unclear on the differences) by somehow packaging it into a single DLL? If yes, then how do I actually create this DLL from my web site/application in VS2008, and how do I then reference it in the parent web site?

如果我完全偏离轨道在这里,我怎么能创造以其他方式这个父/子组合?孩子(说真的,校准工具我最终会写)确实需要在ASP.NET(使用C#),但我没有在父网站的任何控制,因为它是别人的code,他们只是希望能够在我的效用下降。

If I am totally off track here, how can I create this parent/child combination in some other way? The child (really, the calibration utility I will eventually write) does need to be in ASP.NET (with C#) but I don't have any control over the parent site, since it's someone else's code, and they just want to be able to drop in my utility.

感谢您的帮助!更具体的你可以,就更好了。我很新的ASP.NET和Visual Studio,虽然我有很多其他语言和IDE编程经验的。

Thanks for the help! The more specific you can be, the better. I am very new to ASP.NET and Visual Studio, though I do have plenty of experience programming in other languages and IDEs.

推荐答案

如果您知道客户端还使用ASP.Net,你可以建立它作为一个用户控件。

If you know the client also uses ASP.Net, you could build it as a User Control.

这篇关于我如何嵌入一个ASP.NET网站(或Web应用程序)到另一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆