473,386 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

RFV. Problem with ID. I think ...

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

Nov 14 '06 #1
0 850

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
2
by: mark | last post by:
I've been working on an Access 2000 database for a couple of weeks now. I took a course in access about a year ago, a crash course, and I learned a ton, but I didn't touch Access for the year since...
17
by: Danny J. Lesandrini | last post by:
The following code works with a standard MDB to navigate to a particluar record (with a DAO recordset, of course) but it's giving me problems in an ADP I'm working on. Dim rs As ADODB.Recordset...
53
by: Felix Kater | last post by:
Hi, when accessing the variables in a struct: What's the reason why in C you have -> and . instead of only . ? Are there cases in which the compiler couldn't figure out what to do? Felix
56
by: maadhuu | last post by:
hello, this is a piece of code ,which is giving an error. #include<stdio.h> int main() { int a =10; void *p = &a; printf("%d ", *p ); //error....why should it //be an error ?can't the...
39
by: clintonG | last post by:
This is not about starting a fight but an observation that seems to be proving itself on its own merit and is therefore simply a point of conjecture. I did not get serious about writing software...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
67
by: Robert | last post by:
Hi, I have been reading the article at http://www.crockford.com/javascript/private.html and I was wondering if there also was some way to be able to have private methods that can be called from...
56
by: Squishy | last post by:
I tried installing my VS2005 Pro on Vista Ultimate 32 bit RTM today and got errors stating that VS2005 was not compatible with Vista. Microsoft......please pull your finger out of my ass and tell...
0
by: raylopez99 | last post by:
I ran afoul of this Compiler error CS1612 recently, when trying to modify a Point, which I had made have a property. It's pointless to do this (initially it will compile, but you'll run into...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.