locked
'Eval' is not declared. It may be inaccessible due to its protection level RRS feed

  • Question

  • User-786564416 posted
                         <asp:TemplateField HeaderText="Storage Location" >
                                <ItemTemplate>
                                    <asp:Label ID="StorageField" runat="server" text='<%# Eval("ServerStoragePath")%>' CssClass="FormulaFieldStyle"   />  
                                </ItemTemplate>
                                <ItemStyle BorderWidth="1px" Width="45%" HorizontalAlign="left" />
                            </asp:TemplateField>
    
                            
                    <asp:TemplateField HeaderText="Reference Formula" SortExpression="PostingPrefix">
                                <ItemTemplate>
                                    <asp:Label ID="FormulaField" runat="server" text='<%# Eval("PostingPrefix")%>' CssClass="FormulaFieldStyle"   />  
                                </ItemTemplate>
                                <ItemStyle BorderWidth="1px" Width="15%" HorizontalAlign="right" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="Administration Unit" SortExpression="Name">
                                <ItemTemplate>
                                    <asp:Label ID="NameField" runat="server" text='<%# Eval("Name")%>' CssClass="SourceFieldStyle"   />  
                                </ItemTemplate>
                                <ItemStyle BorderWidth="1px" Width="33%" HorizontalAlign="right" />
                            </asp:TemplateField>
    
                            
                            <asp:TemplateField Visible="false" >
                                <ItemTemplate>
                                    <asp:Label ID="IndxField" runat="server" text='<%# Eval("Indx")%>'  />  
                                </ItemTemplate>
                            </asp:TemplateField>
    
                            <asp:TemplateField Visible="false" >
                                <ItemTemplate>
                                    <asp:Label ID="HeadIndxField" runat="server" text='<%# Eval("ReportingTo")%>'  />  
                                </ItemTemplate>
                            </asp:TemplateField>
    
                            <asp:TemplateField Visible="false" >
                                <ItemTemplate>
                                    <asp:Label ID="UNField" runat="server" text='<%# Eval("LoadedByUserName")%>'   />  
                                </ItemTemplate>
                            </asp:TemplateField>
    
                            <asp:TemplateField>
                                <HeaderStyle Height="20px" /> 
                                <ItemTemplate>
                                    <asp:RadioButton ID="GridView1_RadioButton" runat="server"  AutoPostBack="True" GroupName="RadioGroup" OnCheckedChanged="GridView_RadioButton_CheckedChanged" />
                                </ItemTemplate> 
                                <ItemStyle BorderWidth="1px" Width="2%" /> 
                            </asp:TemplateField>
                            
    
                        

    This works fine on my development PC, but when I deploy it to our live server it fails saying: Compiler Error Message: BC30451: 'Eval' is not declared. It may be inaccessible due to its protection level.

    Most pages doesn't have problem with using the Eval.

    When I made a research, I got the following suggestion, but actually I don't know how to apply it:

    '' The important detail turned out to be that we were updating from v2.0 to v4.0 and that we were copying files over the top of the previous deployment.

    There were v2.0 precompiled website DLLs still in the bin directory on the server from the previous deployment. As the precompiled DLL names change between releases the old ones were not replaced. Somehow having v2.0 and v4.0 DLLs in the same directory was confusing the server. As I didn't have these old DLLs on my development machine I was not seeing the same problems.

    Deleting the old DLLs has fixed the issue ''

    How to apply the suggestion on the server running the website IIS?

    Tuesday, February 27, 2018 1:05 PM

All replies

  • User-707554951 posted

    Hi alihusain_77

    The important detail turned out to be that we were updating from v2.0 to v4.0 and that we were copying files over the top of the previous deployment.

     There were v2.0 precompiled website DLLs still in the bin directory on the server from the previous deployment. As the precompiled DLL names change between releases the old ones were not replaced. Somehow having v2.0 and v4.0 DLLs in the same directory was confusing the server. As I didn't have these old DLLs on my development machine I was not seeing the same problems.

     Deleting the old DLLs has fixed the issue.

    Best regards

    Cathy

    Wednesday, February 28, 2018 2:52 AM