AI OnAI Off
Hi, Kartheek,
To begin with, it's a partial view, so you shouldn't have the entire page with Layout and <html>...
Probably PartialView(currentBlock) is not looking in the same place you put your Index.cshtml, you can try that out by specifying the path to the file.
BR,
Marija
Hi Guys,
i want to create my own form conatainer, I extract the Forms.UI folder and took FormContainerInitScript.ascx as reference code,here is my code
CustomFormContainerBlock.cs:
namespace EpiserverSite5.Models.CustomElements
{
[ContentType(DisplayName = "Custom Form ContainerBlock", GUID = "57d9f7b1-5bc4-4d96-9921-5f07bf176c49", Description = "")]
public class CustomFormContainerBlock : FormContainerBlock
{
}
}
CustomFormContainerBlockController.cs:
public class CustomFormContainerBlockController : BlockController
{
public override ActionResult Index(CustomFormContainerBlock currentBlock)
{
return PartialView(currentBlock);
}
}
Index.cshtml:
@model EpiserverSite5.Models.CustomElements.CustomFormContainerBlock
@using System.Web.Mvc
@using EPiServer.Forms.Helpers.Internal
@using EPiServer.Forms.Implementation.Elements
@using EPiServer.Forms.EditView.Internal
@using EPiServer.ServiceLocation
@{
Layout = null;
}
@{
var _formParagraphTextService = ServiceLocator.Current.GetInstance
var _formValidationService = ServiceLocator.Current.GetInstance
var _formDataSubmissionService = ServiceLocator.Current.GetInstance
var _formConfig = ServiceLocator.Current.GetInstance
}
Using aboce code i able to drag and drop in container but am unable to display it in admin mode and UI mode,if anyone have any idea regrad this matter can any one help me out of this.
Thanks,
Kartheek