Your class is derived from a
UserControl
, not a
Page
.
VerifyRenderingInServerForm
is a
Page
method and thus it is not possible to override it unless the class derives in some way from
Page
- which
UserControl
doesn't.
UPDATE:
I've had a closer look at this, and it isn't something I've ever needed to do, so I have no idea if it will work for you when using a Custom Control, since it is all supposed to happen while the page is rendering, not as a result of a button press or similar.
But...it might!
Move the VerifyRenderingInServerForm override into your Page code - it won't work in your UserControl at all.
Then, edit your Page source and look for the Page directive:
<%@ Page Title="" Language="C#" MasterPageFile="~/Resources/Masters/OverAllBasic.master"
AutoEventWireup="true" EnableEventValidation="false" CodeFile="AdminMain.aspx.cs" Inherits="SecurityPagesAdminOnly_AdminMain" %>
Add the
EnableEventValidation="false"
part in mine.
Now try the code. It should work...if you are lucky (I didn't try it in a user control, but it should work)