Unable to find control id 'lbCountry2' referenced by the 'ControlToValidate' property of 'rfvSelectedCountry'.


I am trying to validate a listbox inside a control that is called like this from my page:

<uc1:LinkedLists ID="llCountrySelector1" runat="server"></uc1:LinkedLists>

This control is used at other places on the site so I cant add the validator in the control directly.

The question is this, how can i put a required field validator on a list box inside this control?

I tried this but got got the error in the message title:

' validation
Me.rfvSelectedCountry.ControlToValidate = Me.llCountrySelector1.RightList.ID



2/18/2007 5:45:49 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 29

if your problem is you only want to validate the listbox control inside that user control when being placed inside a specific place

you can put the validator control inside that user control as disabled by default, create a public boolean (true or false) property on the user control, inside it put an if condition which checks the property if it's true then you enable the validator control.


Haissam Abdul Malak
| Blog |
2/18/2007 7:53:24 PM

Similar Artilces:

Unable to find control id 'TextBox1' referenced by the 'ControlToValidate' property of 'RequiredFieldValidator1'.
Unable to find control id 'TextBox1' referenced by the 'ControlToValidate' property of 'RequiredFieldValidator1'.i'm getting error when i the page is derived from master.page.i'm using a "required field validator" to validate same web user control in the master.pagefiles are:master.pagedefault3.aspx (content of master.page)ucUserControlPage"Unable to find control id 'ctl00_ContentPlaceHolder1_PanelID_VisitDetails2_UcHostName1_ddlHostName_wrapper' referenced by the 'ControlToValidate' property of 'rfvHostName'." ...

Unable to find control id 'rblXXX' referenced by the 'ControlToValidate' property of 'rfvXXX'.
I'm trying to add a dynamically created collection of requiredfieldvalidator controls to a gridview during Page_Load.  If I just add the rfv controls to the form it works fine but when I try to add them to a gridview control I get this error.  Here's my code: Working code: Just adds controls to form at bottom of pageFor Each c As Control In validators Form.Controls.Add(c) Next   Code causing error:For Each c As Control In validatorsDim gridView As GridView = Me.grvSectionA gridView.Rows(r).Cells(2).Controls.Add(c) r += 1 Next   Mark Gagnon...

Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/ GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

'do' won't 'do' if '/'
Greetings to All from Au, Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\NW.pm to try and standardise on '/' separators. If I run a test script (t/uni/lower.t) with an unmodified NW.pm, it calls t/uni/case.pl, that, in case.pl, (when the path separators are '\'), the $file is '..\lib\unicore\To\Lower.pl' and the following code portion works, with $simple getting a returned table: sub casetest { my ($base, $spec, $func) = @_; my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "lib", &qu...

Name: L Lachowsky Email: e2brutus_10atyahoodotcom Product: Firefox Summary: ''' Comments: why duddn this surprise me... I change default server from IE to Mozilla, and then i get error messages. well, shud I decide to not get on my computer with Mozilla..or shud I risk security breeches with IE....hmmm at least i can get on the internet with IE Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/2008120122 Firefox/3.0.5 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this fee...

Cast from type ''''DBNull'''' to type ''''String'''' is not valid.
How do I avoid getting this error: Cast from type ''''DBNull'''' to type ''''String'''' is not valid. I am trying to get values from the database into a form for updating using a Datareader, SQL is set to allow nulls for certain fields as they are not required but the only way I can get the form to display is by adding a space in SQL. Is there another way around this? Check if it is equal to DBNull.Value first and if it is, don't do the cast.Stanley Tan theSpoke Blog Where in the code does it need to go? I am using the following and it's the profile that isn't always requi...

table_info('','','','%') cannot return any types
I was recently confirming table_info special cases and discovered the case for getting table_types cannot work. table_info('','','','%') should return a list of table types but it returns a list of empty strings instead: my @types = $h->tables('', '', '', '%'); print "all types:\n", join("xxx\n", @types), "\n"; # should output something like: # "dbo" # "INFORMATION_SCHEMA" # "sys" # and actually outputs: xxx xxx It seems to be down to the following ...

Hello. I'm using defferent 5.6.0's for Win32. I wonder wheter following behaviour is intentional or not: d:\>perl -e "print 'b'..'c'" bc d:\>perl -e "print 'b'..'a'" bcdefghijklmnopqrstuvwxyz I expected empty list in latter case, like in perl -e "print 'bb'..'a'" <!ENTITY Vadim REALLIFE "Vadim V.Konovalov, St.Petersburg, Russia"> &Vadim; On Wed, Sep 20, 2000 at 03:14:41PM +0400, Konovalov, Vadim wrote: > Hello. > > I'm using defferent 5.6.0'...

'IN' Clause or 'OR'
Hello, [1]: select * from TABLEA where COL1 IN('value1','value2''valu3'....) [2]:select * from TABLEA where COL1 = 'value1' OR COL1= 'value2' OR COL1='valu3'. TABLEA is a huge table and it has non-clustered index on COL1. Among the above 2 queries, which query will give me the better performance or fast response and WHY? What is the difference between 'IN' and 'OR' clauses as for as Sybase Optimization is concerned. Which is the better one to be used on huge tables. Thanks. Mac An IN list is treated ...

'or' or 'union'
Hello I was just wondering, in general what is better to use, an 'or' clause in a select or a 'union' to join two selects together. Do both statements create work tables? Many thanks Alex I think OR will be better than union. because suppose u have 3 tables and using OR u can join table a and table b and table c so each table will have only one read. but using union you will join table a and table b and in another query of union u will use table (a or b) and table c so ur one read is more in union . Ramdas Alex Cheung wrote: > Hello > >...

Could not find control '' in ControlParameter ''
Hello All I have a repeater with controls, some draw from different SqlDatasources. Everything loads up properly, I click my update button and then I get the error: "Could not find control 'txtProjectName' in ControlParameter 'projectName'" The Control txtProjectName is in the repeater <itemTemplate> <asp:TextBox ID="txtProjectName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "projectName") %>' /> My Datasource that I want to update looks like this:  <asp:SqlDataSource ID="dsEditProject" runat="server" ConnectionString="<%$ ConnectionString...

'System.Web.UI.Control.Context' denotes a 'property' where a 'class' was expected
I get the following error when trying to compile my project. The call to Context lies in a usercontrol. It works fine when called from a page, but how do I call it from a usercontrol? private User _currentUser = new User(Context.User.Identity.Name); 'System.Web.UI.Control.Context' denotes a 'property' where a 'class' was expected Firefox - The browser you can trust Update: private User _currentUser = new User(Context.User.Identity.Name);Is declared inside the class, not in a function. Like: public class Someclass : System.Web.UI.UserControl { private User _currentUser = new...

Control '{0}' referenced by the ControlToValidate property of '{1}' cannot be validated.
Hi At Page_Load lTotalRows gets a number. And if the user clicks on btDoSomething then the postback should kick in only if lTotalRows is less then ddlCount. But I get this error: Control 'lTotalRows' referenced by the ControlToValidate property of 'valcDoSomething' cannot be validated. Any idea why? <asp:literal id="lTotalRows" text="0" runat="server" /> <asp:dropdownlist id="ddlCount" runat="server">   <asp:listitem text="10" />   <asp:listitem text="20" />   <asp:listitem text="30" />   <asp:listitem text="4...

Web resources about - Unable to find control id 'lbCountry2' referenced by the 'ControlToValidate' property of 'rfvSelectedCountry'. - asp.net.web-forms

Resources last updated: 1/14/2016 5:06:04 PM