Object reference not set to an instance of an object

Dec 24, 2009 at 9:02 PM

I've seen others with this problem using nested masterpages but I'm not using nested masterpages. Perhaps I am doing something wrong.

I'm just trying to test this in an .aspx page. I have this with my imports:

<%@ Register Assembly="RichTextEditor" Namespace="AjaxControls" TagPrefix="cc1" %>

and in the body:

<cc1:RichTextEditor ID="rte1" runat="server" />

At first I downloaded the .dll and added it to my bin directory, but that gave me:

Object reference not set to an instance of an object in the toolbar.cs file in a directory that didn't exist.

So I got the source and built it, then put the resulting .dll and .pdb files in my bin directory, now I get the same 'Object reference not set to an instance of an object.' But this time I have the source for the error:

Line 187:
Line 188:            cssLink.Href = Global.Instance.Resource.GetUrl(this.Page, "AjaxControls.Toolbar.css");
Line 189:            this.Page.Header.Controls.Add(cssLink);
Line 190:
Line 191:            Global.Instance.Resource.RegisterClientScript(this.Page, this.Controls, "AjaxControls.Microsoft.js");

What do I need to do to fix this error?

Dec 24, 2009 at 10:48 PM

Nevermind, I got it working. If I had just looked at the code a minute, I would have realized I needed runat="server" in my <head> tag for this to work