Tech Off Post

Single Post Permalink

View Thread: ASP.Net User control with codebehind not working
  • User profile image

    I had the same problem today, but it is in C#.

    all you need to do is declare the control with it's name instead of declaring it as a user control. For instance, in my case:

    public class sniff : System.Web.UI.UserControl {

    code here


    is then instantiated on my page thus:

    protected sniff ctrl_Sniff;

    I had tried to do it this way unsuccessfully:

    protected System.Web.UI.UserControl ctrl_Sniff;


    ~ Knute