Problem creating wrapper

Discussion in 'ASP .Net Building Controls' started by Stephen, Jan 7, 2005.

  1. Stephen

    Stephen Guest

    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
     
    Stephen, Jan 7, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stephen

    Creating a Wrapper

    Stephen, Jan 5, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    1,392
  2. Edvard Majakari
    Replies:
    4
    Views:
    545
    Edvard Majakari
    May 27, 2004
  3. Tim
    Replies:
    4
    Views:
    798
    wb_peter
    Sep 27, 2006
  4. ma740988
    Replies:
    9
    Views:
    350
    ma740988
    Oct 10, 2006
  5. SoofaLoofa
    Replies:
    2
    Views:
    308
    Kevin Sookocheff
    Mar 14, 2008
Loading...

Share This Page