I have the following class…
public class MyCustomLogger
{
public static int DEFAULT_INFO = 0;
public static int DEFAULT_LOGIN = 1;
//etc
public static void Log( ... )
{
doStuff(...);
}
public static void Log( ... , ... )
{
doStuff(...);
}
private static void doStuff(...)
{
//doLots of Stuff
}
So when I call MyCustomLogger.Log(...);
from another Custom Class… it works fine. No compile errors…nothing. It just works
When I call it from SuchAndSuch.master code behind… it works fine. No Compile errors…nothing. It just works.
When I call it from SuchAndSuch.ascx code behind… it works fine. No Compile errors…nothing. It just works.
However… when I call it from SuchAndSuch.aspx code behind… it doesn't work. I'm getting 'MyCustomLogger' does not contain a definition for 'Log'
I'm getting this from any aspx page I add it to.
EDIT
Here's a snippet from the aspx pages i'm trying to add it to
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Logout : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//doStuff
}
protected void Button1_Click(object sender, EventArgs e)
{
MyCustomLogger.Log(MyCustomLogger.DEFAULT_INFO);
Has anyone else experienced this?
Best Answer
Here are a few ideas on what might be causing this: