Accessing public static class files from .ASPX file using Eval("") from gridView

Hi I am new to this system, please be gentle with me. The problem I am now having is the inability to call the class file from ASPX through Eval. The class file is located in "~/classes" folder. Please provide me with methods and ways to evade this error or even solve it thank you!! ^^

Programming language : C# Problem found in : .ASPX gridView Problem also found in : EstateDBManager class file Error Message : DataBinding: 'DWAD_Project.classes.Volunteer' does not contain a property with the name 'EstateDBManager'. Codes for partial gridView below :

    <asp:TemplateField HeaderText="Estate Name" SortExpression="EstateId">
      <EditItemTemplate>
        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("EstateDBManager.findEstate({0}).Name") %>'></asp:TextBox>
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="Label1" runat="server" Text='<%# Eval("EstateDBManager.findEstate({0}).Name") %>'></asp:Label>
      </ItemTemplate>
    </asp:TemplateField>

Codes for partial EstateDBManager Class file below:

    namespace DWAD_Project.classes
    {
      public static class EstateDBManager
      {
        public static Estate findEstate(int ID)
        {
           // processes ...
        }
      }
    }

Thanks for replies and helps!! ^^

Answer to the problem: GridView :

      <asp:TemplateField HeaderText="Estate Name" SortExpression="EstateId">
      <EditItemTemplate>
        <asp:TextBox ID="TextBox1" runat="server" Text='<%# DWAD_Project.classes.EstateDBManager.findEstate(Eval("EstateId")).Name %>'></asp:TextBox>
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="Label1" runat="server" Text='<%# DWAD_Project.classes.EstateDBManager.findEstate(Eval("EstateId")).Name %>'></asp:Label>
      </ItemTemplate>
    </asp:TemplateField>

Class file :

    namespace DWAD_Project.classes
    {
      public static class EstateDBManager
      {
        public static Estate findEstate(int ID)
        {
           // processes ...
        }
      }
    }

Answers


Eval is for properties of the data source. If you need just code don't use Eval

'<%# EstateDBManager.findEstate(Eval("EstateId")).Name %>'

You just have to convert the Eval result to the right type since it is object (e.g. (int)Eval("EstateId"))


Need Your Help

Wrong result when converting temperatures

python python-2.7

I am the getting wrong result in my python 2.7 interpreter on ubuntu 12.04.

C# Color constant R,G,B values

c# colors rgb system.drawing.color

Where can I find a list of all the C# Color constants and the associated R,G,B (Red, Green, Blue) values?