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

  • Home
  • SEARCH
  • 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 705591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:04:16+00:00 2026-05-14T04:04:16+00:00

We have a updatable web site project that is written in c#, it has

  • 0

We have a updatable web site project that is written in c#, it has the usual web form implementation using master page, skins, user controls,…etc. Up to this point we neglect to change the default compilation language from VB to C#. However, the second we change it, we see the following error.

Object reference not set to an instance of an object. --->
System.NullReferenceException: Object reference not set to an instance
of an object. at ASP.Default.__DataBinding__control499(Object sender,
EventArgs e) at System.Web.UI.Control.OnDataBinding(EventArgs e) at
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at
System.Web.UI.Control.DataBindChildren() at
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at
System.Web.UI.Control.DataBindChildren() at
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at
System.Web.UI.Control.DataBindChildren() at
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at
System.Web.UI.Control.DataBindChildren() at
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at
....

Further investigation points out that this error is getting generated from a Theme related assembly (Source : App_Theme_Default.zclakrlo). Any ideas?

One of my co-worker suggested that it might be skin file related since we have a theme call “Default” and there is no way to specify a language on a skin file. Therefore, when the asp.net runtime tries to compile it under C#, it will give a name collision? Does this make sense?

Any help is appreciated.

Update:
It turns out that there is a span tag in one of the skin file which look like the following:

<span runat="server" visible='<%# Eval("foo") %>'>

where foo is a string value of either “true” or “false”. For some reason, this works under VB compilation, but fails in C#.

The fix is to change the type of foo from string to bool. All in all, very weird edge case!

  • 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-05-14T04:04:16+00:00Added an answer on May 14, 2026 at 4:04 am

    This is because the code for this control ultimately distills into something like the following for VB:

    Public Sub __DataBinding__control499(ByVal sender As Object, ByVal e As EventArgs)
        Dim control As HtmlGenericControl = DirectCast(sender, HtmlGenericControl)
        Dim bindingContainer As IDataItemContainer = DirectCast(control.BindingContainer, IDataItemContainer)
        control.Visible = CBool(MyBase.Eval("Foo"))
    End Sub
    

    …where as in C# it is:

    public void __DataBinding__control499(object sender, EventArgs e)
    {
        HtmlGenericControl control = (HtmlGenericControl) sender;
        IDataItemContainer bindingContainer = (IDataItemContainer) control.BindingContainer;
        control.Visible = (bool) base.Eval("foo");
    }
    

    CBool actually accepts any numeric or string expression whereas the direct cast from Eval(“foo”) to bool will fails in this case because Eval(“foo”) isn’t a boolean.

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

Sidebar

Related Questions

I have a VS2008 Web Application project that is being pre-compiled without being updatable.
I have a page with a div that is dynamically filled using a paginator
Have just started using Google Chrome , and noticed in parts of our site,
I am using Stripes for a project and have a situation I cannot understand.
I have a project that adds elements to an AutoCad drawing. I noticed that
I have a new web app that is packaged as a WAR as part
I have a login.jsp page which contains a login form. Once logged in the
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have a n-tire web application and search often times out after 30 secs. How
I'm using VisualSVN client and server and one of the requirements for web projects

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.