03-16-06 12:48 PM
Hi Michael,
a solution for this already exists:
http://www.gotdotnet.com/Community/...C9-C7378FB0FDBB
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------
"drazic19" <drazic19@discussions.microsoft.com> wrote in message
news:472E6648-CD77-4AE7-8D1B-1A2EDA9D5FC2@microsoft.com...
> Hi,
>
> Been trying to create a control to set the ordinality of a posting from
> the
> webauthor, could someone help, point me in the right direction etc.
>
> Code so far is:
>
> Public Class MovePostingUp : Inherits BasePostbackAction
>
> Dim currentOrdinality As Integer
>
> Private Sub moveUp()
> Try
> Dim cmsContext As CmsHttpContext = CmsHttpContext.Current
> Dim cmsPosting As Posting = cmsContext.Posting
> currentOrdinality = cmsPosting.SortOrdinal
>
> If (currentOrdinality <> 0) Then
> currentOrdinality = currentOrdinality - 1
> Else
> currentOrdinality = currentOrdinality
> End If
>
> If (cmsContext.Mode <> PublishingMode.Update) Then
> 'Me.Page.Response.Redirect(cmsPosting.UrlModeUpdate,
> True)
> cmsPosting.SortOrdinal = currentOrdinality
> cmsContext.CommitAll()
> End If
>
> 'Me.Page.Response.Redirect(cmsPosting.UrlModeUnpublished,
> True)
>
> Catch ex As Exception
>
> End Try
>
> End Sub
>
> Public Overrides Property Text() As String
> Get
> moveUp()
> Return "Move Up Order " + currentOrdinality.ToString
> End Get
> Set(ByVal Value As String)
>
> End Set
> End Property
>
> Public Overloads Overrides ReadOnly Property Available() As Boolean
> Get
> Return CmsHttpContext.Current.Channel.CanCreatePostings
> End Get
> End Property
>
> End Class
>
> Any help would be great thanks,
>
> Michael
[ Post a follow-up to this message ]
|