Click the button to pop up a new window, return and refresh the page after entering the data.

xiaoxiao2021-03-05  24

In some .Net Forum, some people will often ask: How to click the button in the page to open a new page, enter the data, then return to the initial page and update? To solve this problem, you should figure out the usage of WINDOW.SHOWMODALDIALOG (), you have already done it at http://www.9cbs.sp?id=15113. Here, use the example to describe how this feature is implemented in ASP.NET. This example has a total of 3 pages, where WebForm2.aspx is a transition page, which is to open a new page when submitting. Webform1.aspx <% @ page language = "vb" autoeventwireup = "false" codebehind = "Webform1.aspx.vb" inherits = "ShowModalDialog.webform1"%>%>

Webform1

WebForm1.aspx.vb Public Class WebForm1 Inherits System.Web.UI.Page Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm Protected WithEvents Label1 As System.Web. Ui.WebControls.Label protected withevents button1 as system.web.ui.webcontrols.button #Region "Web Form Designer Generated Code" The call is required for the web form designer.

PRIVATE SUB Initialization () End Sub Private Sub Page_init (Byval E AS System.EventArgs) Handles mybase.init 'Codegen: This method call is required by the Web Form Designer' Do not use the code editor Modify it. InitializeComponent () End Sub #End Region Private Sub Page_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'If the user code is placed in the page initialization here (Not IsClientScriptBlockRegistered ( "clientScript")) Then Dim strScript As String = "