Microsoft Content Management Server - Redirecting a User to the Attachment Placeholder

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > December 2005 > Redirecting a User to the Attachment Placeholder





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Redirecting a User to the Attachment Placeholder
JumpingMattFlash

2005-12-19, 7:48 am

I'm trying to create a file download page whereby postings are created using
a template containing only a file attachment placeholder. On viewing the page
they are redirected to the URL of the file.

I've tried directing the user to
SingleAttachmentPlaceholderControl1.AttachmentUrl but this just redirects to
the channel name and not the channelname + posting name

Any ideas?

Many thanks in advance
Matt Brooke
--
=============
VB .NET Developer
http://www.rocketscience.uk.com
Stefan [MSFT]

2005-12-19, 7:48 am

Hi,

actually redirecting to the URL below should not redirect to the channel and
should also not redirect to a posting.
It should redirect to the attachment.
Something seems to be wrong in your code or the AttachmentUrl contains a
wrong Url. Please verify the Url in this property.

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
----------------------


"JumpingMattFlash" <JumpingMattFlash@discussions.microsoft.com> wrote in
message news:69D7CCF9-68B6-4471-A1D2-6681023A2A82@microsoft.com...
> I'm trying to create a file download page whereby postings are created
> using
> a template containing only a file attachment placeholder. On viewing the
> page
> they are redirected to the URL of the file.
>
> I've tried directing the user to
> SingleAttachmentPlaceholderControl1.AttachmentUrl but this just redirects
> to
> the channel name and not the channelname + posting name
>
> Any ideas?
>
> Many thanks in advance
> Matt Brooke
> --
> =============
> VB .NET Developer
> http://www.rocketscience.uk.com



JumpingMattFlash

2005-12-22, 7:49 am

On examining the contents of the AttachmentUrl property, it returns nothing.
I've tried getting the contents using the generic placeholder property but i
cant seem to find any information on the Url.

TIA,
Matt Brooke
--
=============
VB .NET Developer
http://www.rocketscience.uk.com


"Stefan [MSFT]" wrote:

> Hi,
>
> actually redirecting to the URL below should not redirect to the channel and
> should also not redirect to a posting.
> It should redirect to the attachment.
> Something seems to be wrong in your code or the AttachmentUrl contains a
> wrong Url. Please verify the Url in this property.
>
> 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
> ----------------------
>
>
> "JumpingMattFlash" <JumpingMattFlash@discussions.microsoft.com> wrote in
> message news:69D7CCF9-68B6-4471-A1D2-6681023A2A82@microsoft.com...
>
>
>

Mark Mahacek

2005-12-22, 5:55 pm

I've done this on our site. My template has one SingleAttachmentPlaceholder
called "DocumentLink" and I have set this so the redirect only happens when
a guest user visit the site. This way authors can change the attachment
content, but users will just be directed to the resource.


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim cmsContext As CmsHttpContext = CmsHttpContext.Current
Dim currentPosting As Posting = cmsContext.Posting
Dim attachPH As AttachmentPlaceholder =
currentPosting.Placeholders("DocumentLink")
If cmsContext.IsLoggedInAsGuest Then
Response.Redirect(attachPH.Url)
End If
End Sub

This is based on a template to redirect the user to a URL based on the
content of a TextBoxPlaceholder.

--
Mark Mahacek
Merced County Office of Education


"JumpingMattFlash" <JumpingMattFlash@discussions.microsoft.com> wrote in
message news:69D7CCF9-68B6-4471-A1D2-6681023A2A82@microsoft.com...
> I'm trying to create a file download page whereby postings are created
> using
> a template containing only a file attachment placeholder. On viewing the
> page
> they are redirected to the URL of the file.
>
> I've tried directing the user to
> SingleAttachmentPlaceholderControl1.AttachmentUrl but this just redirects
> to
> the channel name and not the channelname + posting name
>
> Any ideas?
>
> Many thanks in advance
> Matt Brooke
> --
> =============
> VB .NET Developer
> http://www.rocketscience.uk.com



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com