Click here to Skip to main content
15,924,829 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: cache???? Pin
Guffa14-Nov-06 21:21
Guffa14-Nov-06 21:21 
GeneralRe: cache???? Pin
Neeraj Arora15-Nov-06 0:47
Neeraj Arora15-Nov-06 0:47 
QuestionNeed help with forum Pin
feras_8014-Nov-06 17:32
feras_8014-Nov-06 17:32 
AnswerRe: Need help with forum Pin
GaryWoodfine 14-Nov-06 22:11
professionalGaryWoodfine 14-Nov-06 22:11 
QuestionHow to move the Sidebar in wizard control to top? Pin
verinder_bindra14-Nov-06 17:26
verinder_bindra14-Nov-06 17:26 
QuestionHow to access remote file system Pin
vicky45714-Nov-06 13:33
vicky45714-Nov-06 13:33 
QuestionRepeatColumns in asp:repeater Pin
karanba14-Nov-06 11:07
karanba14-Nov-06 11:07 
QuestionRFV. Problem with ID. I think ... Pin
shapper14-Nov-06 10:44
shapper14-Nov-06 10:44 
Hello,

I am creating a custom control which uses TextBoxes and Required field validator. I am using INamingContainer in my custom control.

When I use the control in a page I get an error:

"The ControlToValidate property of 'rfvEmail' cannot be blank. "

I have no idea why I am getting this error. It is like I did not referenced the rfvEmail.ControlToValidate. But I did.

I tried everything I could think off but had no luck.

Could somebody help me out?

Here is my code:

Public Class MyControl
Inherits WebControl
Implements INamingContainer

Private WithEvents tbEmail As New WebControls.TextBox
Private WithEvents rfvEmail As New WebControls.RequiredFieldValidator

Private Sub tbEmail_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbEmail.Init
tbEmail.Width = Unit.Pixel(200)
End Sub

Private Sub rfvEmail_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles rfvEmail.Init
.ControlToValidate = tbEmail.ID ' ???????? ERROR ?????????
.Display = ValidatorDisplay.Dynamic
.ErrorMessage = "Required Field"
End Sub

Protected Overrides Sub CreateChildControls()

MyBase.Controls.Add(tbEmail)
MyBase.Controls.Add(rfvEmail)

MyBase.CreateChildControls()
Me.ChildControlsCreated = True

End Sub

End Class

Thank You Very Much,

Miguel
AnswerRe: RFV. Problem with ID. I think ... Pin
indianet14-Nov-06 12:04
indianet14-Nov-06 12:04 
GeneralRe: RFV. Problem with ID. I think ... Pin
shapper14-Nov-06 12:14
shapper14-Nov-06 12:14 
AnswerRe: RFV. Problem with ID. I think ... Pin
Guffa14-Nov-06 12:38
Guffa14-Nov-06 12:38 
Questionnewbie help Pin
ozeegers14-Nov-06 8:19
ozeegers14-Nov-06 8:19 
AnswerRe: newbie help Pin
Not Active14-Nov-06 8:33
mentorNot Active14-Nov-06 8:33 
AnswerRe: newbie help Pin
Grapes-R-Fun14-Nov-06 8:54
Grapes-R-Fun14-Nov-06 8:54 
GeneralRe: newbie help Pin
ozeegers14-Nov-06 11:04
ozeegers14-Nov-06 11:04 
QuestionRe: newbie help Pin
Grapes-R-Fun14-Nov-06 16:31
Grapes-R-Fun14-Nov-06 16:31 
AnswerRe: newbie help Pin
ozeegers15-Nov-06 1:49
ozeegers15-Nov-06 1:49 
AnswerRe: newbie help Pin
ozeegers16-Nov-06 11:37
ozeegers16-Nov-06 11:37 
GeneralRe: newbie help Pin
Grapes-R-Fun16-Nov-06 16:05
Grapes-R-Fun16-Nov-06 16:05 
GeneralRe: newbie help Pin
Grapes-R-Fun17-Nov-06 2:23
Grapes-R-Fun17-Nov-06 2:23 
GeneralRe: newbie help Pin
ozeegers18-Nov-06 6:25
ozeegers18-Nov-06 6:25 
GeneralRe: newbie help Pin
Grapes-R-Fun27-Nov-06 4:41
Grapes-R-Fun27-Nov-06 4:41 
GeneralRe: newbie help Pin
ozeegers19-Nov-06 0:47
ozeegers19-Nov-06 0:47 
GeneralRe: newbie help Pin
Grapes-R-Fun27-Nov-06 4:35
Grapes-R-Fun27-Nov-06 4:35 
GeneralRe: newbie help Pin
Grapes-R-Fun28-Nov-06 3:18
Grapes-R-Fun28-Nov-06 3:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.