I am trying to create a subclass of asp:DropDownList so I can use asp:DdlNoEventValidation instead. This is so I can circumvent event validation.
Here’s the page directive
<%@ Register TagPrefix="asp" Namespace="System.Web.UI.WebControls" Assembly="NoValidationDropDownList" %>
and here’s the class that is supposed to inherit the DropDownList (it’s a seperate .cs file sitting App_Code)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
namespace System.Web.UI.WebControls
{
public class DdlNoEventValidation : System.Web.UI.WebControls.DropDownList
{
}
}
Here are the error’s I’m getting
Warning 1 Element ‘DdlNoEventValidation’ is not a known element. This
can occur if there is a compilation error in the Web site, or the
web.config file is missing.Error 2 Could not load file or assembly ‘NoValidationDropDownList’ or
one of its dependencies. The system cannot find the file specified.Error 3 Unknown server tag ‘asp:DdlNoEventValidation’.
This should be simple and I’m obviously doing something very wrong despite trawling here and the rest of the Internet for an answer. This is driving me insane, please help!
Here are some references on how to do this (never use the same namespace from the framework itself when creating your own classes !):
DropDownListsubclass)