我已经开始搜索它并看到其他用户的帖子已经出现同样的问题了。 所有帖子都有相同的解决方案。我遵循了所有的步骤和代码,但我仍然无法解决问题。我仍然无法访问声明的属性。
我是Vb.net的新手,请原谅,如果这是一个愚蠢的问题。
以下是我的usercontrol的代码
Public Class CustomUserControls
Dim msg As String
Dim innerMsg As String
Dim modal As Boolean
Public Property SetMessage() As String
Get
Return msg
End Get
Set(value As String)
msg = value
End Set
End Property
Public Property SetInnerMsg() As String
Get
Return innerMsg
End Get
Set(value As String)
innerMsg = value
End Set
End Property
Public Property PopUpModal() As Boolean
Get
Return modal
End Get
Set(value As Boolean)
modal = value
End Set
End Property
End Class
这是我的usercontrol设计代码:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ShowMessageControl.ascx.vb" Inherits="UserControls_ShowMessageControl" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Button runat="server" ID="DummyForMessagebox" style="display:none;" />
<asp:ModalPopupExtender ID="ModalShowMessage" runat="server" TargetControlID="DummyForMessagebox">
</asp:ModalPopupExtender>
<asp:Panel runat="server" ID="pnlShowMessage">
<div class="modal">
<div class="modal-header">
<i class="icon-info-sign"></i>`enter code here`
<h5>Header</h5>
</div>
<div class="modal-body">
<asp:Label runat="server" ID="lblMessage" CssClass="text-info"></asp:Label>
<asp:Label runat="server" ID="lblInnerMessage"></asp:Label>
</div>
<div class="modal-footer">
<asp:Button runat="server" ID="btnOk" />
</div>
</div>
</asp:Panel>
并在我的aspx文件中
<uc1:ShowMessageControl runat="server" ID="ShowMessageControl" />
以及我在尝试访问我的usercontrol属性时想要的内容
ShowMessageControl.MustApperProperty
但是当我showmessagecontrol然后点...时,没有声明的属性出现