Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8175057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:37:50+00:00 2026-06-06T22:37:50+00:00

I have an ascx that uses Eval in a repeater like this: <%@ Control

  • 0

I have an ascx that uses Eval in a repeater like this:

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Similar.ascx.vb" Inherits="x.y.z.Similar" %>
<asp:repeater runat="server" id="rptAlternatives" visible="false" Enableviewstate="false">
    <HeaderTemplate>
        <section id="similar" class="sidelist sideModule">
            <h3>Possible Alternatives:</h3> 
            <ul class="sideborder">
    </HeaderTemplate>
    <ItemTemplate>
        <li>
            <a href="/bar/<%# Eval("URL")%>" class="box">foo</a>
        </li>
    </ItemTemplate>
    <FooterTemplate>
            </ul>
        </section>
    </FooterTemplate>
</asp:repeater>

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. What’s really odd is that sometimes restarting the application pool makes it go away and then sometimes it comes back again. Also it’s not breaking on every page that uses Eval.

The local environment is IIS 7.5.7600.16385 with an application pool running ASP.NET v4.0 Classic. The server environment is the same. I publish from VS on my machine and copy this onto the live server to deploy.

Before this deployment the live site was using v2.0. Upgrading the site to v4.0 is part of the changes we’re trying to release. This code has not changed as part of this release. It has always used Eval, and this has always been fine.

I have installed the Visual Studio 11 beta, but I’m using 2010 for this project.

Any ideas what could be causing this?

Edit:

This experts exchange post seems to describe exactly the same behaviour. They “fixed” it by changing the name of their class in both ascx and ascx.vb files. They matched before the change and they matched after the change, but the change obviously jogged something in the compiler. I might give this a go, but it doesn’t seem satisfactory that a particular ascx would just stop working.

I’ve also found plenty of posts suggesting changing it to DataBinder.Eval(Container.DataItem, "URL"). However, I’m again reluctant to do this when the code worked before and has suddenly stopped. It’s a magic and random “fix” that I’m unwilling to use.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:37:53+00:00Added an answer on June 6, 2026 at 10:37 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a BarEditor.ascx, that can be called from diffent places. <%@ Control Language=C#
I have an ASP.NET user control (.ascx file). In this user control I want
I have an ASCX that inherits from a WebControl that has a 'CustomConfiguration' property
I have ascx partial view with html-layout like that <%=Html.ActionLink<PersonController>(x => x.Publications(param1, param2, ...
I have a User control(ascx) that has an Update panel. When the page is
I have a user control that uses the standard if(!IsPostBack){//initialize myself} paradigm to avoid
I have an ASCX control that has to render Silverlight dynamically. The dynamic code
I have a custom ASCX control that is not visible in design mode in
The Scenario I have an ASP.Net Web Project that uses a master page. This
I have web user control A that uses another web user control B. Inside

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.