Reference to parent in license-enabled class constructor

N

Nik Kalyani

I am using LicenseProvider to enable licensing for a web user control
using C#. My license consists of a signed XML .lic file. Among other
things, the .lic file contains the namespace for which the license is
valid (example: Acme.Apps.*). The goal here is to allow the control to
be used only by pages in certain namespaces.

Here's my dilemma...in order to validate the license, my control's
constructor needs to obtain the namespace of the ASP.Net page that is
the control's parent. However, it appears that until the license
validation is complete, that the class does not get instantiated and
references to "this" or "this.parent" return null. This is
understandable, but poses a Catch-22 for me.

My question: Is there any way in which I can obtain the namespace of
the parent for my control within the constructor of that same control.
Ordinarily, this is trivial, but with LicenseProvider, it seems like I
have to use System.Reflection or some other exotic way to accomplish
this task. I have scoured the web and have not found any way to do
this. Any help would be appreciated.

-- Nik
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top