webauthor control to set ordinality of a posting
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > webauthor control to set ordinality of a posting




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    webauthor control to set ordinality of a posting  
drazic19


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-15-06 10:52 PM

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 ]



    Re: webauthor control to set ordinality of a posting  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:26 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register