Error Creating Control CustomWebControls1 Unknown Server Tag cc1: CustomWebControls

R

Ryan

I am trying to program a modified version of the password reset
control. I have written the following code (below). When I add it to
my tool box and then attempt to add it to the page, I get the message:

Error Creating Control CustomWebControls1 Unknown Server Tag cc1:
CustomWebControls

I think, though am not sure, that this has something to with my nested
class and the toolbox tag in the source code:

<DefaultProperty("Text"),
ToolboxData("<{0}:AdministratorDrivenSecurityControls.PasswordReset
runat=server></{0}:CustomWebControls.CustomWebControls>")> _

Does anyone know why I am getting this error and how to correct it?

Thank you!
Ryan
------------CODE BELOW---------------

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.Security
Imports System.Web.Configuration


Namespace CustomWebControls
Public Class AdministratorDrivenSecurityControls
Protected Shared Function
GetDefaultMemberStoreConnectionString(Optional ByVal path = "") As
String
Dim webConfig As System.Configuration.Configuration

Dim mbrshpSection As MembershipSection
'Dim mbrshpConnectionStringName As String
Dim curPage As New System.Web.UI.Page

webConfig =
WebConfigurationManager.OpenWebConfiguration(path)
mbrshpSection = webConfig.GetSection("system.web/
membership")
Return
(webConfig.ConnectionStrings.ConnectionStrings(mbrshpSection.Providers(mbrshpSection.DefaultProvider).Parameters("connectionStringName")).ToString)

End Function
<DefaultProperty("Text"),
ToolboxData("<{0}:AdministratorDrivenSecurityControls.PasswordReset
runat=server></{0}:CustomWebControls.CustomWebControls>")> _
Public Class PasswordReset
Inherits CompositeControl

'Object Child Controls
Private cpdChangePassword As ChangePassword
Private WithEvents btnChangePassword As Button
Private WithEvents ddlSecurityQuestion As DropDownList
Private txtSecurityAnswer As TextBox
Private vldValidator As RequiredFieldValidator


Dim curPage As System.Web.UI.Page
Dim mbrshpConnectionString As String

'Event Handlers
Private Sub btnChangePassword_OnClick(ByVal sender As
Object, ByVal e As System.EventArgs) Handles btnChangePassword.Click
Me.Page.Response.Write("Test")


End Sub
Private Sub ddlSecurityQuestion_OnInit(ByVal sender As
Object, ByVal e As System.EventArgs) Handles ddlSecurityQuestion.Init
Me.Page.Response.Write("Test2")
End Sub
'Properties
Public ReadOnly Property SecurityQuestion() As Integer
Get
EnsureChildControls()
Return ddlSecurityQuestion.SelectedValue
End Get
End Property

Public Property SecurityAnswer() As String
Get
EnsureChildControls()
Return txtSecurityAnswer.Text
End Get
Set(ByVal value As String)
EnsureChildControls()
txtSecurityAnswer.Text = value
End Set
End Property

Protected Overrides Sub CreateChildControls()
curPage = Me.Page
mbrshpConnectionString =
GetDefaultMemberStoreConnectionString(curPage.Server.MapPath(curPage.Request.ApplicationPath))

cpdChangePassword = New ChangePassword
cpdChangePassword.ID = "cpdChangePassword"
Me.Controls.Add(cpdChangePassword)

ddlSecurityQuestion = New DropDownList
ddlSecurityQuestion.ID = "ddlSecurityQuestion"
Me.Controls.Add(ddlSecurityQuestion)

txtSecurityAnswer = New TextBox
txtSecurityAnswer.ID = "txtSecurityAnswer"
Me.Controls.Add(txtSecurityAnswer)

vldValidator = New RequiredFieldValidator
vldValidator.ID = "vldValidator"
vldValidator.ControlToValidate = cpdChangePassword.ID
vldValidator.ErrorMessage = "(Required)"
vldValidator.Display = ValidatorDisplay.Dynamic
Me.Controls.Add(vldValidator)

btnChangePassword = New Button
btnChangePassword.ID = "btnChangePassword"
Me.Controls.Add(btnChangePassword)
'btnChangePassword.CommandName = "ChangePassword"

End Sub
End Class
End Class
End Namespace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top