Dynamic binding to statically declared custom server control?

D

Donal McWeeney

Hi,

Not sure if I am using the correct terminology, but why can I dynamically
bind to statically declared asp.net server controls but cannot do so with
custom server controls - with the custom controls I get a null reference
exception. Is there any workarounds...

eg.

In my aspx page I declare the following:

<%@ Page language="C#" Inherits="MyCustomPage, etc" %>
<%@ Register Tagprefix="MCC" Namespace="MyCustomControls" Assembly="etc" %>


<MCC:CustomInputBox runat="server" id="customInputBox" ... />



In my backend class...

public class MyCustomPage : Page
{
// Page controls
protected CustomInputBox customInputBox ;


Thanks

Donal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,139
Messages
2,570,805
Members
47,351
Latest member
LolaD32479

Latest Threads

Top