Problem creating wrapper

S

Stephen

Hi
I have been asked by our web host to build a wrapper for a third party
component we wish to use on our web application.
The reason behind this was so I could add the two following lines:
[assembly: AssemblyKeyFileAttribute(@"..\..\keyPair.snk")]
[assembly: AllowPartiallyTrustedCallersAttribute()]
and they will then store my wrapper in the GAC and my Application will
access the component using my trusted wrapper.


I have never built a wrapper before and I am getting the following
error when I attempt to view the page with my component/wrapper on it:

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
Line 13: <body MS_POSITIONING="GridLayout">
Line 14: <form id="Form1" method="post" runat="server">
Line 15: <cc1:TestButton id="TestButton1" style="Z-INDEX: 101;
LEFT: 200px; POSITION: absolute; TOP: 48px" <-THIS LINE
Line 16: runat="server"></cc1:TestButton></form>
Line 17: </body>

All that i have done is place my component on the form (no code) and
set the licence key in the Global.asax.cs file (code here, but this
part seems to work fine).

The error is probably because I have no idea how to write a wrapper,
so here is the code for my wrapper. (It is a web control library)

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace ButtonComponent
{
[DefaultProperty("Text"),
ToolboxData("<{0}:TestButton runat=server></{0}:TestButton>")]
public class TestButton : Xceed.Chart.Server.ChartServerControl
{

static public void SetKey()
{
Xceed.Chart.Server.Licenser.LicenseKey = "xxx";
}
}
}

All that i want the wrapper to do is allow me to access the regular
functions and properties of ChartServerControl component, so I thought
that this would do, obviously I was wrong.
I really have no idea what i am doing, so any help would be greatly
appreciated.
Thank you very much
Stephen
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top