如何在另一个aspx表单中打开aspx表单?

本文关键字:表单 aspx 另一个 | 更新日期: 2023-09-27 18:12:57

我必须这样做的原因是因为在另一个页面上,它必须继承dll类名。

beePlugInIntegration.index使dll代码工作。

然而,我不能简单地改变主页继承类,因为整个系统会崩溃。

最后,我想的是在主页面打开子页面,这样我就可以继承这两个类并使其工作。但是我使用的是

BeePlugInSection.Controls.Add(LoadControl("~/index.aspx"))

但是它返回给我这个

Server Error in '/WebLITE' Application.
Type 'ASP.index_aspx' does not inherit from `System.Web.UI.UserControl`.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.Web.HttpException: Type 'ASP.index_aspx' does not inherit from 'System.Web.UI.UserControl'.
Source Error: 

有人能帮我在aspx中打开另一个表单类吗?

如何在另一个aspx表单中打开aspx表单?

你的异常清楚地表明

类型的ASP。index_aspx'没有从'System.Web.UI.UserControl'继承。

意味着你必须使用UserControl而不是Page。

创建一个用户控件,在页面或web上注册它。