Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > CMServer General > Custom Console ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 10648 of 10773
Post > Topic >>

Custom Console Control Error

by =?Utf-8?B?ZHJhemljMTk=?= <michaeldraisey@[EMAIL PROTECTED] > Jun 11, 2008 at 08:00 AM

Hi all,

I have a custom console item (item sort action) from the old gotdotnet
site. 
It worked fine in .net 1.x but now i've ****ted it to .net 2.0 i get the 
following error:

The property cannot be accessed before the Control.OnInit() phase. 

Line 16:             Get
Line 17:                 If Me.Available Then
Line 18:                     Return "CMS_openWindowPageProperties('" + 
Me.UrlNewWindow + "');" <-- Error
Line 19:                     
Me.Page.Response.Redirect(CmsHttpContext.Current.Posting.UrlModeUnpublished,

True)
Line 20:                 Else
 
The code running this is:

    Public Class ItemSortAction
        Inherits BaseNewWindowAction

        Dim _siteName As String
        Dim DIALOG_ROOT_PATH As String = siteName + "CustomDialogs/"

        Public Overrides ReadOnly Property ActionJavascript() As String
            Get
                If Me.Available Then
                    Return "CMS_openWindowPageProperties('" + 
Me.UrlNewWindow + "');"
                    
Me.Page.Response.Redirect(CmsHttpContext.Current.Posting.UrlModeUnpublished,

True)
                Else
                    Return String.Empty
                End If
            End Get
        End Property

        Private Sub ItemSortOrder_Init(ByVal sender As Object, ByVal e As 
System.EventArgs) Handles Me.Init
            MyBase.OnInit(e)
            Me.UrlNewWindow = DIALOG_ROOT_PATH + 
"ItemOrdering.aspx?NRMODE=Update&ChannelGuid=" + 
Page.Server.UrlEncode(CmsHttpContext.Current.Channel.Guid)
        End Sub

        Public Overloads Overrides ReadOnly Property Available() As
Boolean
            Get
                Dim canSortOneItem As Boolean = False
                Dim cmsContext As CmsHttpContext = CmsHttpContext.Current
                Dim colItems As ChannelAndPostingCollection = 
cmsContext.Channel.AllChildren
                For Each currItem As ChannelItem In colItems
                    If currItem.CanSetProperties Then
                        canSortOneItem = True
                        ' break 
                    End If
                Next
                Return (MyBase.Available AndAlso canSortOneItem)
            End Get
        End Property

        Public Overrides Property Text() As String
            Get
                Return "Sort Menu Items"
            End Get
            Set(ByVal Value As String)

            End Set
        End Property


        ''' <summary>
        ''' Public property used to get the string name for the correct
site
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property siteName() As String
            Get
                Return _siteName
            End Get
            Set(ByVal Value As String)
                _siteName = Value
            End Set
        End Property

    End Class

Thanks for any help in advance,

Michael
 




 1 Posts in Topic:
Custom Console Control Error
=?Utf-8?B?ZHJhemljMTk=?=   2008-06-11 08:00:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Dec 4 15:03:34 CST 2008.