473,399 Members | 4,254 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,399 software developers and data experts.

Error on Registering Custom Validator

I was looking at a Custom Validator that 4 Guys had posted that would solve
my RequiredValidator problem with CheckBoxLists and it says it can't find
the .dll. But the dll is in both the Bin folder and the same folder as the
..aspx page.

Here is the error:

Parser Error Message: File or assembly name CustomValidator.dll, or one of
its dependencies, was not found.
Line 6: <%@ Import Namespace="System.Data.SqlClient" %>
Line 7: <%@ Import Namespace="MyFunctions" %>
Line 8: <%@ Register TagPrefix="CustomValidators"
Namespace="CustomValidators" Assembly="CustomValidators.dll" %>
Line 9: <script runat="server">

The program is:
************************************************** **************************
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace CustomValidators
{
public class RequiredFieldValidatorForCheckBoxLists :
System.Web.UI.WebControls.BaseValidator
{
private ListControl _listctrl;

public RequiredFieldValidatorForCheckBoxLists()
{
base.EnableClientScript = false;
}

protected override bool ControlPropertiesValid()
{
Control ctrl = FindControl(ControlToValidate);

if (ctrl != null)
{
_listctrl = (ListControl) ctrl;
return (_listctrl != null);
}
else
return false; // raise exception
}

protected override bool EvaluateIsValid()
{
return _listctrl.SelectedIndex != -1;
}
}
}

************************************************** ****************************

And the compiler line is:

csc /t:library CustomValidators.cs /r:system.web.dll

It all compiles fine.

Why can't the .aspx page find it?

Thanks,

Tom

Nov 19 '05 #1
5 1315
Nevermind.

I figured it out. I had Assembly="CustomValidators.dll" and I am not
supposed to have the .dll appended to it.

Tom
"tshad" <ts**********@ftsolutions.com> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
I was looking at a Custom Validator that 4 Guys had posted that would solve
my RequiredValidator problem with CheckBoxLists and it says it can't find
the .dll. But the dll is in both the Bin folder and the same folder as the
.aspx page.

Here is the error:

Parser Error Message: File or assembly name CustomValidator.dll, or one of
its dependencies, was not found.
Line 6: <%@ Import Namespace="System.Data.SqlClient" %>
Line 7: <%@ Import Namespace="MyFunctions" %>
Line 8: <%@ Register TagPrefix="CustomValidators"
Namespace="CustomValidators" Assembly="CustomValidators.dll" %>
Line 9: <script runat="server">

The program is:
************************************************** **************************
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace CustomValidators
{
public class RequiredFieldValidatorForCheckBoxLists :
System.Web.UI.WebControls.BaseValidator
{
private ListControl _listctrl;

public RequiredFieldValidatorForCheckBoxLists()
{
base.EnableClientScript = false;
}

protected override bool ControlPropertiesValid()
{
Control ctrl = FindControl(ControlToValidate);

if (ctrl != null)
{
_listctrl = (ListControl) ctrl;
return (_listctrl != null);
}
else
return false; // raise exception
}

protected override bool EvaluateIsValid()
{
return _listctrl.SelectedIndex != -1;
}
}
}

************************************************** ****************************

And the compiler line is:

csc /t:library CustomValidators.cs /r:system.web.dll

It all compiles fine.

Why can't the .aspx page find it?

Thanks,

Tom

Nov 19 '05 #2
Well, it finds it fine, but it doesn't seem to work.

I even put "return false" at the beginning of both methods and it still
didn't raise any error - which it should have regardless of whether a box
was checked or not.

Does anyone know what I did wrong? It seems like a pretty straight forward
control.

Thanks,

Tom

"tshad" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Nevermind.

I figured it out. I had Assembly="CustomValidators.dll" and I am not
supposed to have the .dll appended to it.

Tom
"tshad" <ts**********@ftsolutions.com> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
I was looking at a Custom Validator that 4 Guys had posted that would
solve my RequiredValidator problem with CheckBoxLists and it says it can't
find the .dll. But the dll is in both the Bin folder and the same folder
as the .aspx page.

Here is the error:

Parser Error Message: File or assembly name CustomValidator.dll, or one
of its dependencies, was not found.
Line 6: <%@ Import Namespace="System.Data.SqlClient" %>
Line 7: <%@ Import Namespace="MyFunctions" %>
Line 8: <%@ Register TagPrefix="CustomValidators"
Namespace="CustomValidators" Assembly="CustomValidators.dll" %>
Line 9: <script runat="server">

The program is:
************************************************** **************************
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace CustomValidators
{
public class RequiredFieldValidatorForCheckBoxLists :
System.Web.UI.WebControls.BaseValidator
{
private ListControl _listctrl;

public RequiredFieldValidatorForCheckBoxLists()
{
base.EnableClientScript = false;
}

protected override bool ControlPropertiesValid()
{
Control ctrl = FindControl(ControlToValidate);

if (ctrl != null)
{
_listctrl = (ListControl) ctrl;
return (_listctrl != null);
}
else
return false; // raise exception
}

protected override bool EvaluateIsValid()
{
return _listctrl.SelectedIndex != -1;
}
}
}

************************************************** ****************************

And the compiler line is:

csc /t:library CustomValidators.cs /r:system.web.dll

It all compiles fine.

Why can't the .aspx page find it?

Thanks,

Tom


Nov 19 '05 #3
Tshad,

If you didn't see my earlier post take a look. I have already built the
validator you need. Even if you don't want to use my object as is it is free
with source code so you can always just look at the code to see what you
need to do.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"tshad" <ts**********@ftsolutions.com> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Well, it finds it fine, but it doesn't seem to work.

I even put "return false" at the beginning of both methods and it still
didn't raise any error - which it should have regardless of whether a box
was checked or not.

Does anyone know what I did wrong? It seems like a pretty straight
forward control.

Thanks,

Tom

"tshad" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Nevermind.

I figured it out. I had Assembly="CustomValidators.dll" and I am not
supposed to have the .dll appended to it.

Tom
"tshad" <ts**********@ftsolutions.com> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
I was looking at a Custom Validator that 4 Guys had posted that would
solve my RequiredValidator problem with CheckBoxLists and it says it
can't find the .dll. But the dll is in both the Bin folder and the same
folder as the .aspx page.

Here is the error:

Parser Error Message: File or assembly name CustomValidator.dll, or one
of its dependencies, was not found.
Line 6: <%@ Import Namespace="System.Data.SqlClient" %>
Line 7: <%@ Import Namespace="MyFunctions" %>
Line 8: <%@ Register TagPrefix="CustomValidators"
Namespace="CustomValidators" Assembly="CustomValidators.dll" %>
Line 9: <script runat="server">

The program is:
************************************************** **************************
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace CustomValidators
{
public class RequiredFieldValidatorForCheckBoxLists :
System.Web.UI.WebControls.BaseValidator
{
private ListControl _listctrl;

public RequiredFieldValidatorForCheckBoxLists()
{
base.EnableClientScript = false;
}

protected override bool ControlPropertiesValid()
{
Control ctrl = FindControl(ControlToValidate);

if (ctrl != null)
{
_listctrl = (ListControl) ctrl;
return (_listctrl != null);
}
else
return false; // raise exception
}

protected override bool EvaluateIsValid()
{
return _listctrl.SelectedIndex != -1;
}
}
}

************************************************** ****************************

And the compiler line is:

csc /t:library CustomValidators.cs /r:system.web.dll

It all compiles fine.

Why can't the .aspx page find it?

Thanks,

Tom



Nov 19 '05 #4
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:O7*************@TK2MSFTNGP15.phx.gbl...
Tshad,

If you didn't see my earlier post take a look. I have already built the
validator you need. Even if you don't want to use my object as is it is
free with source code so you can always just look at the code to see what
you need to do.
I couldn't find your post on the validator control, but I did look at your
site and found the section, so will look at it later today.

Thanks,

Tom
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"tshad" <ts**********@ftsolutions.com> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Well, it finds it fine, but it doesn't seem to work.

I even put "return false" at the beginning of both methods and it still
didn't raise any error - which it should have regardless of whether a box
was checked or not.

Does anyone know what I did wrong? It seems like a pretty straight
forward control.

Thanks,

Tom

"tshad" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Nevermind.

I figured it out. I had Assembly="CustomValidators.dll" and I am not
supposed to have the .dll appended to it.

Tom
"tshad" <ts**********@ftsolutions.com> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
I was looking at a Custom Validator that 4 Guys had posted that would
solve my RequiredValidator problem with CheckBoxLists and it says it
can't find the .dll. But the dll is in both the Bin folder and the same
folder as the .aspx page.

Here is the error:

Parser Error Message: File or assembly name CustomValidator.dll, or one
of its dependencies, was not found.
Line 6: <%@ Import Namespace="System.Data.SqlClient" %>
Line 7: <%@ Import Namespace="MyFunctions" %>
Line 8: <%@ Register TagPrefix="CustomValidators"
Namespace="CustomValidators" Assembly="CustomValidators.dll" %>
Line 9: <script runat="server">

The program is:
************************************************** **************************
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace CustomValidators
{
public class RequiredFieldValidatorForCheckBoxLists :
System.Web.UI.WebControls.BaseValidator
{
private ListControl _listctrl;

public RequiredFieldValidatorForCheckBoxLists()
{
base.EnableClientScript = false;
}

protected override bool ControlPropertiesValid()
{
Control ctrl = FindControl(ControlToValidate);

if (ctrl != null)
{
_listctrl = (ListControl) ctrl;
return (_listctrl != null);
}
else
return false; // raise exception
}

protected override bool EvaluateIsValid()
{
return _listctrl.SelectedIndex != -1;
}
}
}

************************************************** ****************************

And the compiler line is:

csc /t:library CustomValidators.cs /r:system.web.dll

It all compiles fine.

Why can't the .aspx page find it?

Thanks,

Tom




Nov 19 '05 #5
Tom,

You're welcome. The post was in reply to one of your own posts earlier in
the forum...

If you have any questions about the control fee free to email me.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"tshad" <ts**********@ftsolutions.com> wrote in message
news:uW**************@TK2MSFTNGP15.phx.gbl...
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:O7*************@TK2MSFTNGP15.phx.gbl...
Tshad,

If you didn't see my earlier post take a look. I have already built the
validator you need. Even if you don't want to use my object as is it is
free with source code so you can always just look at the code to see what
you need to do.


I couldn't find your post on the validator control, but I did look at your
site and found the section, so will look at it later today.

Thanks,

Tom

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"tshad" <ts**********@ftsolutions.com> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Well, it finds it fine, but it doesn't seem to work.

I even put "return false" at the beginning of both methods and it still
didn't raise any error - which it should have regardless of whether a
box was checked or not.

Does anyone know what I did wrong? It seems like a pretty straight
forward control.

Thanks,

Tom

"tshad" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Nevermind.

I figured it out. I had Assembly="CustomValidators.dll" and I am not
supposed to have the .dll appended to it.

Tom
"tshad" <ts**********@ftsolutions.com> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
>I was looking at a Custom Validator that 4 Guys had posted that would
>solve my RequiredValidator problem with CheckBoxLists and it says it
>can't find the .dll. But the dll is in both the Bin folder and the
>same folder as the .aspx page.
>
> Here is the error:
>
> Parser Error Message: File or assembly name CustomValidator.dll, or
> one of its dependencies, was not found.
> Line 6: <%@ Import Namespace="System.Data.SqlClient" %>
> Line 7: <%@ Import Namespace="MyFunctions" %>
> Line 8: <%@ Register TagPrefix="CustomValidators"
> Namespace="CustomValidators" Assembly="CustomValidators.dll" %>
> Line 9: <script runat="server">
>
> The program is:
> ************************************************** **************************
> using System;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> using System.ComponentModel;
>
> namespace CustomValidators
> {
> public class RequiredFieldValidatorForCheckBoxLists :
> System.Web.UI.WebControls.BaseValidator
> {
> private ListControl _listctrl;
>
> public RequiredFieldValidatorForCheckBoxLists()
> {
> base.EnableClientScript = false;
> }
>
> protected override bool ControlPropertiesValid()
> {
> Control ctrl = FindControl(ControlToValidate);
>
> if (ctrl != null)
> {
> _listctrl = (ListControl) ctrl;
> return (_listctrl != null);
> }
> else
> return false; // raise exception
> }
>
> protected override bool EvaluateIsValid()
> {
> return _listctrl.SelectedIndex != -1;
> }
> }
> }
>
> ************************************************** ****************************
>
> And the compiler line is:
>
> csc /t:library CustomValidators.cs /r:system.web.dll
>
> It all compiles fine.
>
> Why can't the .aspx page find it?
>
> Thanks,
>
> Tom
>
>
>



Nov 19 '05 #6

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

Similar topics

2
by: Mike P | last post by:
I have a Custom validator that has ControlToValidate set to a textbox that also has a Required and RegularExpression validator. When I run the webpage on my machine the custom validator...
3
by: abcd | last post by:
I get following error. I have 2 simple text boxes and requiresValidator control attached to them. When run on development machine is works when deployed on production server I get following errors....
5
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This is used for comparing a value enterd by the user against the primary key in the SQL database. IF the VALUE ENTERED BY THE...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
3
by: Andy | last post by:
Hi folks, I have a customvalidator control that works properly if it isn't contained in an ASP:TABLE. But, when I place it inside an ASP:TABLE, I find that _ServerValidate doesn't get fired,...
3
by: darrel | last post by:
(apologies for the repost...I put this in the wrong newgroup the first time...) I have a text box that I have a custom validator attached to. I then have an image button that is set to NOT cause...
4
by: Rick | last post by:
Hello, I built a composite web control that has a textbox and a date control. added my custom control on a webform where there are other standard controls. Each control on the form has a...
1
by: Artie | last post by:
Hi, Is there any way to tell an XSD Schema that you want custom error codes for particular validation failures in an XML document? To show what I mean, here's an example: XSD excerpt ...
0
by: Artie | last post by:
On Apr 21, 11:48 am, Martin Honnen <mahotr...@yahoo.dewrote: Thanks for your reply Martin. I was hoping for something generic rather than validator-specific, but I'll try in a Microsoft group...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.