i have hosted the DocuVieware in an asp.net servercontrol, every time i want to start a customcallback (PostCustomServerAction), the viewer shows me an error:
"GdPicture12.WEB.DocuViewareCore.Requests.CustomActionRequestCtx: session expired."
Can anybody help me?
Here's the code of my servercontrol:
Code: Select all
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports GdPicture12.WEB
Imports DevExpress.Web
<ToolboxData("<{0}:DocumentEditorWeb runat=server></{0}:DocumentEditorWeb>")>
Public Class DocumentEditorWeb
Inherits WebControl
Implements INamingContainer
Public Event CustomAction(sender As Object, e As CustomActionEventArgs)
Private WithEvents mcDocuVieware As DocuVieware
Private mcGlobalEvents As ASPxGlobalEvents
Private mcDocumentEditManager As DocumentEditManager
Property ClientInstanceName As String
Public ReadOnly Property DocumentEditManager As DocumentEditManager
Get
If mcDocumentEditManager Is Nothing Then
mcDocumentEditManager = New DocumentEditManager(Me)
End If
Return mcDocumentEditManager
End Get
End Property
Protected Overrides Sub CreateChildControls()
Controls.Clear()
CreateControlHierarchy()
ClearChildViewState()
End Sub
Protected Overridable Sub CreateControlHierarchy()
mcDocuVieware = New DocuVieware
mcDocuVieware.ID = "DocuVieware1"
mcDocuVieware.Style.Add("width", "100%")
mcDocuVieware.Style.Add("height", "100%")
mcDocuVieware.ShowAnnotationsSnapIn = False
mcDocuVieware.ShowBookmarksSnapIn = False
mcDocuVieware.ShowSnapInButtonStrip = False
mcDocuVieware.ShowSnapInCollapseButton = False
mcDocuVieware.ShowSnapInPanelHeader = False
mcDocuVieware.ShowTextSearchSnapIn = False
mcDocuVieware.ShowThumbnailsSnapIn = False
mcDocuVieware.ShowToolbar = False
Controls.Add(mcGlobalEvents)
Controls.Add(mcDocuVieware)
End Sub
Public ReadOnly Property Viewer As DocuVieware
Get
EnsureChildControls()
Return mcDocuVieware
End Get
End Property
Protected Overrides Sub OnPreRender(e As EventArgs)
MyBase.OnPreRender(e)
Page.ClientScript.RegisterClientScriptResource(GetType(DocumentEdit.DocumentEditorWeb), "DocumentEdit.DocumentEditorWeb.js")
End Sub
Private Sub DocumentEditorWeb_Init(sender As Object, e As EventArgs) Handles Me.Init
If Not [String].IsNullOrEmpty(_ClientInstanceName) Then
Dim serializer = New System.Web.Script.Serialization.JavaScriptSerializer()
Dim script As String = [String].Format("var {0} = new DocumentEditorWebClient({1});", _ClientInstanceName, serializer.Serialize(Me.ClientID))
Dim sb As New System.Text.StringBuilder()
sb.Append("<script language='javascript'>")
sb.Append(script)
sb.Append("</script>")
ScriptManager.RegisterStartupScript(Me.Page, GetType(Page), "RegisterClientInstanceForUserControl_" + _ClientInstanceName, sb.ToString(), False)
End If
End Sub
Private Sub mcDocuVieware_CustomAction(sender As Object, e As CustomActionEventArgs) Handles mcDocuVieware.CustomAction
RaiseEvent CustomAction(sender, e)
End Sub
End Class
Thank you!