I was looking at a Custom Validator that 4 Guys had posted that would solve
my RequiredValidat or 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="Syst em.Data.SqlClie nt" %>
Line 7: <%@ Import Namespace="MyFu nctions" %>
Line 8: <%@ Register TagPrefix="Cust omValidators"
Namespace="Cust omValidators" Assembly="Custo mValidators.dll " %>
Line 9: <script runat="server">
The program is:
*************** *************** *************** *************** *************** *
using System;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Componen tModel;
namespace CustomValidator s
{
public class RequiredFieldVa lidatorForCheck BoxLists :
System.Web.UI.W ebControls.Base Validator
{
private ListControl _listctrl;
public RequiredFieldVa lidatorForCheck BoxLists()
{
base.EnableClie ntScript = false;
}
protected override bool ControlProperti esValid()
{
Control ctrl = FindControl(Con trolToValidate) ;
if (ctrl != null)
{
_listctrl = (ListControl) ctrl;
return (_listctrl != null);
}
else
return false; // raise exception
}
protected override bool EvaluateIsValid ()
{
return _listctrl.Selec tedIndex != -1;
}
}
}
*************** *************** *************** *************** *************** ***
And the compiler line is:
csc /t:library CustomValidator s.cs /r:system.web.dl l
It all compiles fine.
Why can't the .aspx page find it?
Thanks,
Tom
my RequiredValidat or 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="Syst em.Data.SqlClie nt" %>
Line 7: <%@ Import Namespace="MyFu nctions" %>
Line 8: <%@ Register TagPrefix="Cust omValidators"
Namespace="Cust omValidators" Assembly="Custo mValidators.dll " %>
Line 9: <script runat="server">
The program is:
*************** *************** *************** *************** *************** *
using System;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Componen tModel;
namespace CustomValidator s
{
public class RequiredFieldVa lidatorForCheck BoxLists :
System.Web.UI.W ebControls.Base Validator
{
private ListControl _listctrl;
public RequiredFieldVa lidatorForCheck BoxLists()
{
base.EnableClie ntScript = false;
}
protected override bool ControlProperti esValid()
{
Control ctrl = FindControl(Con trolToValidate) ;
if (ctrl != null)
{
_listctrl = (ListControl) ctrl;
return (_listctrl != null);
}
else
return false; // raise exception
}
protected override bool EvaluateIsValid ()
{
return _listctrl.Selec tedIndex != -1;
}
}
}
*************** *************** *************** *************** *************** ***
And the compiler line is:
csc /t:library CustomValidator s.cs /r:system.web.dl l
It all compiles fine.
Why can't the .aspx page find it?
Thanks,
Tom
Comment