views:

342

answers:

3

I am using the SPLongOperation Object in my project to introduce a delay while navigating to a new page.The in-built page uses the default css styles and branding.

I want to customize this page design and apply my own theme and branding.

Please tell me how to apply a custom master page to the page which displays the SharePoint 2007 Spin Wheel having the animated gears_an.gif image.

Thanks in advance.

A: 

Unfortunately the SPLongOperation class is sealed and also hard-codes the gears ASPX file.

It looks like the only way you can changes this is by editing the 12\template\layouts\gear.aspx file. Note that this may cause problems with future product updates that make changes to this file.

Alex Angas
+2  A: 

Alex is right that the only (unsupported!) way to change the page layout would be to update gear.aspx on the file system of each WFE. Note that this would be a farm-wide change unless you're using a copy of LAYOUTS, which is generally recommended if you decide to go this route.

If you really want to get clever, the values of the operation's LeadingHTML and TrailingHtml properties aren't escaped before they are written to the response stream. You could use one of those properties to write a <script> to manipulate the DOM, inject a stylesheet link, etc.

Update: I put together a quick proof-of-concept of script injection here.

dahlbyk
+2  A: 

I don't agree that the only was is to modify the OOB files.

You can solve this without bending the rules by developing a custom HTTPModule. This HTTPModule will detect if you are accessing the page in question and modify its master page according to the following snippet:

private void page_PreInit(object sender, EventArgs e)
{
  Page page = sender as Page;
  // Do your checking/filtering here
  if (true)
  {
    page.MasterPageFile = "<whatever you have.master";
  }
}
Magnus Johansson
You're right - that's probably the best way to do it.
Alex Angas
Except that SPLongOperation just writes directly to the response stream without processing the host page's master/control hierarchy at all. An HttpModule is usually an option, but I don't think it helps here.
dahlbyk