YAFLogo

leonhart2207
12 years ago
Hi,

I am using YAF Forum 1.9.5.5, the forum work very well, at this time I want to create my custom page for user management and document management (I also add more table in YAF Forum database), but I can't find a way to add YAF build-in html editor to my usermanagement.aspx and documentmanagement.aspx page 😞 a lot of error about RegisterClientScript, I try to fix but It still dont' work :(

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

Source Error:

Line 382: }

Line 383:

Line 384: ScriptManager.RegisterClientScriptInclude(thisControl, thisControl.GetType(), name, url);

Line 385: this.AddPageElement(name);

Line 386: }

Does anyone know how to add build-in html editor to custom page 😞

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
12 years ago
If you want to use custom pages inside yaf use the correct way (How to Add Custom Page Guide provided by Dave Burke ). Then you can use yaf controls without any problems.
leonhart2207
12 years ago
Thanks for your reply, I already success in create custom page inside YAF Forum before, but in this case, I want to create custom page outside YAF Forum :cry: :cry:
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
12 years ago

Thanks for your reply, I already success in create custom page inside YAF Forum before, but in this case, I want to create custom page outside YAF Forum :cry: :cry:

Originally Posted by: leonhart2207 

If that is not an option, you need to change the code that causes the exception

change the line from...

YafContext.Current.PageElements.RegisterJsResourceInclude("yafjs", "js/yaf.js");

to...

YafContext.Current.PageElements.RegisterJsResourceInclude(this, "yafjs", "js/yaf.js");

in the file Classes\Editors\BBCodeEditor.cs

Maas
  • Maas
  • 50.2% (Neutral)
  • YAF Forumling
11 years ago
Hello,

I have a similar problem with embedding the BBCodeEditor into a custom page outside the forum.

System.Object.GetType() +0

YAF.Core.Services.PageElementRegister.RegisterJsResourceInclude(Control thisControl, String name, String relativeResourceUrl) +82

System.Web.UI.Control.InitRecursive(Control namingContainer) +186

System.Web.UI.Control.AddedControl(Control control, Int32 index) +189

YAF.Editors.BBCodeEditor.OnInit(EventArgs e) +205

...

I already changed the code in BBCodeEditor.cs, but the problem is still there.

Do you have any suggestions? What is the origin of the problem here?

Thanks in advance!

Maas