Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Error Creating Control CustomWebControls1 Unknown Server Tag cc1: CustomWebControls

Reply
Thread Tools

Error Creating Control CustomWebControls1 Unknown Server Tag cc1: CustomWebControls

 
 
Ryan
Guest
Posts: n/a
 
      02-16-2007
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}:AdministratorDrivenSecurityContr ols.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(mbr shpSection.Providers(mbrshpSection.DefaultProvider ).Parameters("connectionStringName")).ToString)

End Function
<DefaultProperty("Text"),
ToolboxData("<{0}:AdministratorDrivenSecurityContr ols.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.Serv er.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

 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      02-18-2007
Has it added the @Register directive correctly on top of the Page?

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


"Ryan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
>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}:AdministratorDrivenSecurityContr ols.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(mbr shpSection.Providers(mbrshpSection.DefaultProvider ).Parameters("connectionStringName")).ToString)
>
> End Function
> <DefaultProperty("Text"),
> ToolboxData("<{0}:AdministratorDrivenSecurityContr ols.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.Serv er.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
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Unknown server tag" problem when creating custom control dliu ASP .Net 0 03-03-2009 06:36 PM
Error - unknown server tag 'asp.Scriptmanager' Valli ASP .Net 1 10-10-2007 01:52 PM
Parser Error Message: Unknown server tag Fred ASP .Net 1 11-15-2006 12:28 AM
Error creating control..Server tag error w/ custom control on webf =?Utf-8?B?RGF2ZQ==?= ASP .Net 1 07-20-2006 08:39 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM



Advertisments