How to use <iframes> in XAF Web application

StatusIDPriorityType
Closed25283MajorQuestion
ProfileReply
LarryClient

I'm exploring different ways to include external Web content within an in XAF Web applications. I need some help with the following possibilities.

1. How to create a view controller that would allow the use of an element within an ASPxHtmlPropertyEditor.

2. How to use a custom Web user control to display an in a detail view.

3. How to best use the dashboard view to display content within an .

4. Other recommendations for using in XAF using Xafari controls.

Thanks for your help.

Replies

UserDescriptionPosted On
Sasha (Xafari Support)Client

Hello Larry,

This task will take some additional time.

Thanks for your patience.
Regards, Sasha.

Larry

I found a solution for displaying an iframe in a DetailView. Here's the View Controller I used to accomplish this.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.HtmlPropertyEditor.Web;
using System;

namespace Learning_Objectives_Creator.Module.Web.Controllers
{
// For more typical usage scenarios, be sure to check out https://documentation.devexpress.com/eXpressAppFramework/clsDevExpressExpressAppViewControllertopic.aspx.
public partial class HTMLEditorController : ViewController
{
public HTMLEditorController()
{
InitializeComponent();
// Target required Views (via the TargetXXX properties) and create their Actions.
}
protected override void OnActivated()
{
base.OnActivated();
// Perform various tasks depending on the target View.
}
protected override void OnViewControlsCreated()
{
base.OnViewControlsCreated();
// Access and customize the target View control.
}
protected override void OnDeactivated()
{
// Unsubscribe from previously subscribed events and release other references and resources.
base.OnDeactivated();
}

private void HTMLEditorController_Activated(object sender, EventArgs e)
{
ASPxHtmlPropertyEditor propertyEditor =
((DetailView)View).FindItem("WebContentAsset") as ASPxHtmlPropertyEditor;
if (propertyEditor != null)
{
if (propertyEditor.Control != null)
{
AllowIframe(propertyEditor);
}
else
{
propertyEditor.ControlCreated +=
new EventHandler(HTMLEditorController_ViewControlsCreated);
}
}
}
private void AllowIframe(ASPxHtmlPropertyEditor propertyEditor)
{
if (propertyEditor.ViewEditMode == DevExpress.ExpressApp.Editors.ViewEditMode.Edit)
{
propertyEditor.Editor.SettingsHtmlEditing.AllowIFrames = true;
propertyEditor.Editor.SettingsHtmlEditing.AllowYouTubeVideoIFrames = true;
propertyEditor.Editor.SettingsHtmlEditing.AllowScripts = true;
propertyEditor.Editor.SettingsHtmlEditing.AllowHTML5MediaElements = true;
propertyEditor.Editor.SettingsHtmlEditing.AllowObjectAndEmbedElements = true;
propertyEditor.Editor.SettingsHtmlEditing.AllowEditFullDocument = true;
propertyEditor.Editor.SettingsHtmlEditing.EnablePasteOptions = true;
propertyEditor.Editor.SettingsHtmlEditing.AllowedDocumentType = DevExpress.Web.ASPxHtmlEditor.AllowedDocumentType.Both;
propertyEditor.Editor.SettingsHtmlEditing.AllowFormElements = true;
propertyEditor.Editor.SettingsHtmlEditing.AllowIdAttributes = true;
propertyEditor.Editor.SettingsHtmlEditing.AllowStyleAttributes = true;
propertyEditor.Editor.Height = 1000;

}
}

private void HTMLEditorController_ViewControlsCreated(object sender, EventArgs e)
{
AllowIframe((ASPxHtmlPropertyEditor)sender);

}
}
}

× This ticket is closed.

Write US