T
tshad
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
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