[英]ASP.NET Load Control Problems Using VB.NET
I have an ASP.NET page (Page A) that has some HTML and a single HTML control that loads a form (Control A). 我有一个ASP.NET页面(页面A),该页面具有一些HTML和一个加载表单的HTML控件(控件A)。 When I am finished saving the form in Control A, I want the HTML control in Page A to load the next control.
将表单保存到控件A中后,我希望页面A中的HTML控件加载下一个控件。 I have been unable to make this work and any help would be greatly appreciated.
我无法进行这项工作,任何帮助将不胜感激。
This is the code I am using in Control A to trigger the function in Page A to load the control. 这是我在控件A中用来触发页面A中的函数以加载控件的代码。
Protected Sub btnSave2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSave2.Click
Try
Dim ctest As New frmMain
ctest.NextButton()
Catch ex As Exception
This is the function in Page A that is being fired, but not loading anything 这是页面A中正在触发但未加载任何内容的函数
Public Sub NextButton()
Dim cname As New Control
cname = LoadControl("EP/ctlE1_01_03.ascx")
Me.dvContent.Controls.Add(cname)
End Sub
使用虚拟路径:
cname = LoadControl("~/EP/ctlE1_01_03.ascx")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.