views:

324

answers:

1

I need to provision a custom aspx page which does some work and then redirects to another page. Using a _layouts page , AKA an application page won't work since I only want this page accessible to one site collection.

I looked at using pattern #4 from this blog post. It feels pretty hacky, It asks you to drop the dll drop it into the bin of the site collection, and upload the file through SP Designer.

I'd rather have this page be a feature that gets included in my site definition or stapled to an existing site definition. I imagine I could use a feature receiver to deploy the files to the pages SP list. One of the comments on the blog post says as much:

Pardon my ignorance on this maybe I am missing the point completely but wouldnt it be easier to deploy your custom pages by programmatically adding them to the pages splist?

I basically, had a simple .aspx page with a user control. I deployed it via this method.

Has anyone been able to provision a custom page without using a _layouts page.

I guess another option is to keep using a _layouts page, but make sure the referrer is correct.

+4  A: 

Besides application pages, you also have the possibility to create Site Pages.

Site pages are in nature related to application pages, but they reside in a site not in _LAYOUTS.

the welcome page (default.aspx) is an example of such a page.

In the same way as with application pages, it is possible to do codebehind in these pages (check out AC's article on this subject http://www.andrewconnell.com/blog/articles/UsingCodeBehindFilesInSharePointSites.aspx )

You can read this article regarding the subtle differences between application pages and site pages: http://aspalliance.com/1720_SharePoint_Application_and_Site_Pages__Part_1_of_2

you deploy this custom page using a feature, where you specify the file as ghostable (look at the example in ACs article)

hth Anders Rask

Anders Rask
I knew this had to be possible. Andrew Connell's post is exactly what I was looking for.
Peter Walke