Sly
Sly

Reputation: 15217

Render EPiServer XForm on usual page, not inherited from EPiServer

I need to render XForm control on regular page, the one that is not inherited from TempaltePage. Currently I'm getting a message:

Error : Can not create form

With a log entry:

ERROR [85] EPiServer.XForms.WebControls.XFormControl.CreateChildControls - 12.6.1 Can not create form
System.ArgumentNullException: Value cannot be null.  Parameter name: virtualPath
       at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options)
       at EPiServer.XForms.WebControls.XFormControl.CreateChildControls().

I cant inherit from TemplatePage because it requires <head runat="server"> tag, but I'm loading content via ajax and cant have header and other on a page. Is there any way to render XForm in string for example?

Upvotes: 0

Views: 761

Answers (1)

Andreas
Andreas

Reputation: 1355

Try inheriting from EPiServer.SimplePage. That should work.

Upvotes: 2

Related Questions