YAFLogo

leonhart2207
11 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: 3.0.3
11 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
11 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: 3.0.3
11 years ago
Originally Posted by: leonhart2207 

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:



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
10 years ago
Hello,

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

Quote:

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
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button