locked
The base class includes the field '<<CONTROLNAME>>, but its type (<<NAMESPACE.CLASSNAME>>) is not compatible with the type of control (<<NAMESPACE.CLASSNAME>>). RRS feed

  • Question

  • User341825205 posted

    In an aspx page(frmReports.aspx) I have a checklistbox control,Which I am validating using a customusercontrol(CustomListValidator.cs) as suggested by various websites. The validation control overrides the Basevalidator class and is workng fine. Now when I tried to access the Validation control in page load event i am not getting the contorl in the code behind. Now I changed the build action from content to compile for this class file. Now I am able to access the control in the page. But when I am trying to testg the page it gives the following error.

    The base class includes the field 'CBLV_chkbxlstAccode', but its type (CustomListValidator.ListValidator) is not compatible with the type of control (CustomListValidator.ListValidator).

     Can any one guide me ?

     

    frmReports.Aspx

     <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="frmReports.aspx.cs" Inherits="HMLINTRANET.Forms.frmReports" %>
    <%@ Register Namespace="CustomListValidator" TagPrefix="CVL" %>


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
    </head>
    <body class="text" bgcolor="#F8F9FC">
        <form id="form1" runat="server">
       
        <div>
     <asp:CheckBoxList ID="chkbxlstAccode" Enabled="false" runat="server" Height="101px"
                                                                Width="260px"
                                                                 ></asp:CheckBoxList>
                                                               
     <CVL:ListValidator  ID="CBLV_chkbxlstAccode" runat="server" ControlToValidate="chkbxlstAccode" ErrorMessage="A/c Code List Selection is Invalid..."  ValidationGroup="ValidationForShowERPReports"  Display="Dynamic"   >*</CVL:ListValidator>


    <asp:ImageButton ID="imgBtnShow" runat="server" ImageUrl="~/images/show.gIF" OnClick="imgBtnShow_Click"  ValidationGroup="ValidationForShowERPReports"   />
                                                           
        </div>
    </form>
    <body>
    </html>

    CustomListValidator.cs
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.ComponentModel;
    using System.Text;
    namespace CustomListValidator
    {
        public class ListValidator : BaseValidator
        {
            private ListControl _listctrl;
            private bool _isRequired;
           ;
           public ListValidator()
            {
                base.EnableClientScript = false;
                _isRequired = true;
                      }
                    public bool IsRequired
            {
                get
                {
                    return _isRequired;
                }
                set
                {
                    _isRequired = value;
                }
            }
               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()
            {
                          
                int selectedCount = 0;
               
                foreach (ListItem item in _listctrl.Items)
                {
                    if (item.Selected)
                    {
                                           selectedCount++;

                    }
                }
                if (selectedCount == 0 && _isRequired)
                {
                    return false;
                }
              return true;

            }

            protected override void OnPreRender(EventArgs e)
            {
                // Determines whether the validation control can be rendered
                // for a newer ("uplevel") browser.
                // check if client-side validation is enabled.
                if (this.DetermineRenderUplevel() && this.EnableClientScript)
                {
                    Page.ClientScript.RegisterExpandoAttribute(this.ClientID, "evaluationfunction", "CheckIfListChecked");
                    this.CreateJavaScript();
                }
                base.OnPreRender(e);
            }

            protected void CreateJavaScript()
            {
                StringBuilder sb = new StringBuilder();
                sb.Append(@"<script type=""text/javascript"">function CheckIfListChecked(ctrl){");
                sb.Append("\r");
                sb.Append(@"var chkBoxList = document.getElementById(document.getElementById(ctrl.id).controltovalidate);");
                sb.Append("\r");
                sb.Append(@"var chkBoxCount= chkBoxList.getElementsByTagName(""input"");");
                sb.Append("\r");
                sb.Append(@"for(var i=0;i<chkBoxCount.length;i++){");
                sb.Append("\r");
                sb.Append(@"if(chkBoxCount.item(i).checked){");
                sb.Append("\r");
                sb.Append(@"return true; }");
                sb.Append("\r");
                sb.Append(@"}return false; ");
                sb.Append("\r");
                sb.Append(@"}</script>");
                sb.Append("\r");
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "JSScript", sb.ToString());
            }
      
        }
    }

    Friday, August 5, 2011 5:53 AM

Answers

  • User341825205 posted

    At Last I found out the solution.  In the examples given in various sites they have asked to put this new validator class in APP_CODE folder. Now I moved out the class to a new folder and compiled it. Now it is working perfectly as I required.

     

    Thank you for ALL especially CTS-mgraham for helping me in resolving this issue.

    •  

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 11, 2011 9:40 AM

All replies

  • User541108374 posted

    Hi,

    Now I am able to access the control in the page. But when I am trying to testg the page it gives the following error.

    Can you show how you do this? The control gets found correctly and of the correct type?

    Grz, Kris.

    Friday, August 5, 2011 9:45 AM
  • User341825205 posted

    Sorry For te delay in replying, I was away in the week end.

    How can I show the screenshot. where is the provision to attach an image. Now I am able to drag and drop the control from the ToolBox(available in a new group automatically created with my project name[HMLINTRANET Components version 1.0.0.0 .net Component]) to the page  designer.

     <asp:CheckBoxList ID="chkbxlstAccode" Enabled="false" runat="server" Height="101px"  Width="260px" CssClass =" text"     BackColor="#F8F9FC" ></asp:CheckBoxList>
                                                        
    <CVL:ListValidator ID="ListValidator1" runat="server" ControlToValidate="chkbxlstAccode" ErrorMessage="A/c Code List Selection is Invalid..." 
                                                            ValidationGroup="ValidationForShowERPReports"  Display="Dynamic" ></CVL:ListValidator>     
                                                          

     

    Monday, August 8, 2011 12:15 AM
  • User541108374 posted

    Hi,

    How can I show the screenshot. where is the provision to attach an image.

    You upload your picture to say imgur.com and then edit the html of the reply (second button to the right in the toolbar). The forums themselves don't give the opportunity to upload pictures.

    Grz, Kris.

    Monday, August 8, 2011 3:09 AM
  • User3866881 posted

    How can I show the screenshot. where is the provision to attach an image.

    Hello:)

    Another way is that you can register for an MSN account (if you have MSN messanger, you must have that).

    And then turn to the website of MSN,skydrive(http://skydrive.live.com/), after logging successfully, plz add an image there and adjust the Permissions(It'd be under the "Share" node in the right panel) to "Everyone". And then right click the submitted image and press "Copy image url" from the menu. And turn the Editor of our asp.net fourm into HTML mode, where you can paste it and see the image.

    Also you can directly click the "Image" button (at the "simling face"'s left). And paste the copied url of your image.

    Thx again!

    Monday, August 8, 2011 10:13 PM
  • User341825205 posted

    Image is uploaded http://i.imgur.com/4TR8O.jpg

    If I make the pages build action as  CONTENT the page is working properly the way in which I want except it is not accessible in the code behind. When it changes to compile, I am getting parse error when the page is loaded itself.

    Tuesday, August 9, 2011 3:06 AM
  • User1957418580 posted

    Does the problem occur if you set batch="false" in the web.config?  Have a look at this article:

    919284 Error messages when you try to run an ASP.NET 2.0 Web application that is built on the .NET Framework 2.0
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;919284

    If that doesn't help, can you paste in the entire error with the stack trace?

    Tuesday, August 9, 2011 7:15 AM
  • User341825205 posted

    Server Error in '/' Application.
    Parser Error
     Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

     Parser Error Message: The base class includes the field 'ListValidator1', but its type (CustomListValidator.ListValidator) is not compatible with the type of control (CustomListValidator.ListValidator).

    Source Error:

    Line 932:                                                            BackColor="#F8F9FC" ></asp:CheckBoxList>
    Line 933:                                                    
    Line 934:                                                        <CVL:ListValidator ID="ListValidator1" runat="server" ControlToValidate="chkbxlstAccode" ErrorMessage="A/c Code List Selection is Invalid..." 
    Line 935:                                                        ValidationGroup="ValidationForShowERPReports"  Display="Dynamic" ></CVL:ListValidator>    
    Line 936:                                                       


     Source File:  /Forms/frmERPReports.aspx    Line:  934

    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

    Tuesday, August 9, 2011 7:38 AM
  • User1957418580 posted

    Did you try setting batch to fasle?  This is usually some kind of circular reference, so they are a pain to pin down.

    Tuesday, August 9, 2011 4:08 PM
  • User341825205 posted

    In the web config only debug =true is given all other entries are default values.

      <compilation debug="true" >
       <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.ComponentModel.DataAnnotations, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
       </assemblies>
         
       <buildProviders>
        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
       </buildProviders>
      </compilation>

    Wednesday, August 10, 2011 1:19 AM
  • User1957418580 posted

    We shouldn't be batch compiling if debug is true, but to be safe, can you set:

     

    <compilation debug="false" batch="false" >

    And see if that makes s difference.  If not, can you send us the full error message (with stack trace) and your code in the Page_Load?  Like I said this might be a circular reference, so to really troubleshoot, we might need your whole project.  Or can you make a new project with just one page, one checkboxlist and ONLY your validator added to the default toolbox and see if the problem happens?  If not, keep adding the rest of your pages and controls until the problem occurs.

     

    HTH

    Wednesday, August 10, 2011 8:46 AM
  • User341825205 posted

    I have changed the web config as suggested. The error I am getting is

    Server Error in '/' Application.
    Compilation Error
     Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

     Compiler Error Message: CS0433: The type 'CustomListValidator.ListValidator' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\3d9497c7\6896be66_6457cc01\HMLINTRANET.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\App_Code.upslfalg.dll'

    Source Error:


    Line 932:                                                            BackColor="#F8F9FC" ></asp:CheckBoxList>
    Line 933:                                                    
    Line 934:                                                        <CVL:ListValidator ID="ListValidator1" runat="server" ControlToValidate="chkbxlstAccode" ErrorMessage="A/c Code List Selection is Invalid..." 
    Line 935:                                                        ValidationGroup="ValidationForShowERPReports"  Display="Dynamic" ></CVL:ListValidator>    
    Line 936:                                                       


    Source File: d:\PROJECT\HMLINTRANETNEW\HMLINTRANET\Forms\frmErpReports.aspx    Line: 934


    Show Detailed Compiler Output:

    C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE> "C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Routing\3.5.0.0__31bf3856ad364e35\System.Web.Routing.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.DirectoryServices\2.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Design\2.0.0.0__b03f5f7f11d50a3a\System.Design.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\b63a11ca\b4bea55f_6457cc01\DataAccessLayer.DLL" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\c5c93fbe\d84c7568_6457cc01\HMLINTRANET.XmlSerializers.DLL" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\d2c2e8b7\00fb941a_adb5c801\Microsoft.Practices.ObjectBuilder2.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Abstractions\3.5.0.0__31bf3856ad364e35\System.Web.Abstractions.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\3d9497c7\6896be66_6457cc01\HMLINTRANET.DLL" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\4b87365a\76f57c62_6457cc01\RichTextEditor.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Data.Linq\3.5.0.0__b77a5c561934e089\System.Data.Linq.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\b9884a19\ced38c64_d81ccb01\AjaxControlToolkit.DLL" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\bd533f27\a7a44451_b3baca01\Microsoft.Practices.EnterpriseLibrary.Data.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\3.5.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.Common\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.Common.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\95b1fe8b\645f465f_6457cc01\BusinessObjectsLayer.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\App_Code.upslfalg.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Data.Entity\3.5.0.0__b77a5c561934e089\System.Data.Entity.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\8cf54b39\0a1fe65f_6457cc01\BusinessAccessLayer.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions.Design\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.Design.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\455659dd\04d5504e_b3baca01\Microsoft.Practices.EnterpriseLibrary.Common.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.DynamicData\3.5.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\App_Web_frmerpreports.aspx.ba00be51.xueimtae.dll" /debug- /optimize+ /win32res:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\wgeyzhwr.res" /w:4 /nowarn:1659;1699;1701 /warnaserror-  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\App_Web_frmerpreports.aspx.ba00be51.xueimtae.0.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\App_Web_frmerpreports.aspx.ba00be51.xueimtae.1.cs"


    Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
    for Microsoft (R) .NET Framework version 3.5
    Copyright (C) Microsoft Corporation. All rights reserved.

    d:\PROJECT\HMLINTRANETNEW\HMLINTRANET\Forms\frmErpReports.aspx(934,47): error CS0433: The type 'CustomListValidator.ListValidator' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\3d9497c7\6896be66_6457cc01\HMLINTRANET.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\App_Code.upslfalg.dll'
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\3d9497c7\6896be66_6457cc01\HMLINTRANET.DLL: (Location of symbol related to previous error)
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\App_Code.upslfalg.dll: (Location of symbol related to previous error)
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\App_Web_frmerpreports.aspx.ba00be51.xueimtae.0.cs(4262,45): error CS0433: The type 'CustomListValidator.ListValidator' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\3d9497c7\6896be66_6457cc01\HMLINTRANET.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\App_Code.upslfalg.dll'
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\3d9497c7\6896be66_6457cc01\HMLINTRANET.DLL: (Location of symbol related to previous error)
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\App_Code.upslfalg.dll: (Location of symbol related to previous error)

     

    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

    Wednesday, August 10, 2011 9:49 AM
  • User1957418580 posted

    I think here's your circular reference:

     

    d:\PROJECT\HMLINTRANETNEW\HMLINTRANET\Forms\frmErpReports.aspx(934,47): error CS0433: The type 'CustomListValidator.ListValidator' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\assembly\dl3\3d9497c7\6896be66_6457cc01\HMLINTRANET.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\069331f7\2797f96\App_Code.upslfalg.dll'

    I'm going to guess you don't need the HMLINTRANET.dll in your bin directory or in the GAC. 

    Wednesday, August 10, 2011 2:42 PM
  • User341825205 posted

    I hope that we are nearing to the solution of the problem. I have created a new project WEBTEST  and have given two aspx file and two class files in APP_CODE folder for testing in following link

    https://skydrive.live.com/redir.aspx?cid=d3e48adcf58baee7&resid=D3E48ADCF58BAEE7!126

    This zip contains

    1.frmTest_Content.aspx and Custom_ListValidator_Content.cs

    2.frmTest_Compile.aspx and Custom_ListValidator_Compile.cs

    To test, You have to  set the first file as startup file and compile the project and run the project. After the form loaded click the save button. We get an error message. If you select one item and click save it will not show any error message. This is working as I required.

    Here I have given the build option of the class file Custom_ListValidator_Content as CONTENT. Hence I am not able to access the validator contorl in the page load event and set values dynamically. So what I did is I created a new set of files shown in (2). Both the files are same as that of in (1) but the difference is there in the @register key in aspx page the namespace in class file and the build action of the class file.

    Now set frmTest_compile.aspx as startup file and run the project. I am getting the following error. How can I resolve this issue. How do eliminate the refference from one of the file please guide me.

    ERROR MESSAGe

    Server Error in '/' Application.
    Compilation Error
     Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

     Compiler Error Message: CS0433: The type 'Custom_ListValidator_Compile.Custom_ListValidator_Compile' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\App_Code.hp93omdv.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\assembly\dl3\ee596175\9c54dca0_1758cc01\WebTest.DLL'

    Source Error:


    [No relevant source lines]


    Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\App_Web_frmtest_compile.aspx.cdcab7d2.th7smncs.0.cs    Line: 255


    Show Detailed Compiler Output:

    C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE> "C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\App_Code.hp93omdv.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\assembly\dl3\ee596175\9c54dca0_1758cc01\WebTest.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\App_Web_frmtest_compile.aspx.cdcab7d2.th7smncs.dll" /debug- /optimize+ /w:4 /nowarn:1659;1699;1701 /warnaserror-  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\App_Web_frmtest_compile.aspx.cdcab7d2.th7smncs.0.cs" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\App_Web_frmtest_compile.aspx.cdcab7d2.th7smncs.1.cs"


    Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
    for Microsoft (R) .NET Framework version 3.5
    Copyright (C) Microsoft Corporation. All rights reserved.

    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\App_Web_frmtest_compile.aspx.cdcab7d2.th7smncs.0.cs(255,54): error CS0433: The type 'Custom_ListValidator_Compile.Custom_ListValidator_Compile' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\App_Code.hp93omdv.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\assembly\dl3\ee596175\9c54dca0_1758cc01\WebTest.DLL'
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\App_Code.hp93omdv.dll: (Location of symbol related to previous error)
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\96630560\2eb5d1fe\assembly\dl3\ee596175\9c54dca0_1758cc01\WebTest.DLL: (Location of symbol related to previous error)

     

    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

     

     

     

     

    Thursday, August 11, 2011 7:14 AM
  • User341825205 posted

    At Last I found out the solution.  In the examples given in various sites they have asked to put this new validator class in APP_CODE folder. Now I moved out the class to a new folder and compiled it. Now it is working perfectly as I required.

     

    Thank you for ALL especially CTS-mgraham for helping me in resolving this issue.

    •  

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 11, 2011 9:40 AM