0

我正在尝试使用 ShowDialog 从我的 aspx 页面显示一个弹出框,然后从中获取返回值。我创建了要调用的表单,但无法将其注册到我的初始页面。这是我的新表单中的所有代码;

Partial Class MyForm
    Inherits System.Web.UI.Page

End Class

以及我初始页面中的相关代码;

Partial Class List
    Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim request As New MyForm
End Sub

End Class

但 Visual Studio 无法识别MyForm. 我究竟做错了什么?


不确定它们是否相关,但这是我的新页面的页面声明;

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="MyForm.aspx.vb" 
Inherits="MyForm" %>

对于我的原始形式;

<%@ Page Language="VB" MasterPageFile="../../../Site.master" 
CodeFile="List.aspx.vb" Inherits="List" %>
4

1 回答 1

0

您不能像在 Windows 窗体中那样使用 ShowDialog 在 ASP.NET 中显示弹出框。如果您需要在 ASP.NET 中显示弹出窗口,请使用ASP.NET ModalPopupJQuery 对话框

此外,在 ASP.NET 中,您不会像正在做的那样调用表单。您只需重定向到它。检查HttpResponse.Redirect 方法

于 2012-08-09T16:33:13.903 回答