Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Header User Control on every page.

  Asked By: Mindy    Date: Nov 08    Category: Sharepoint    Views: 1677

I have a header User Control (.ascx) to replace team site header. I can render User Control from a web application and also display User Controls using Jan's Smart Part within a web part.

Requirement is to display it at the top of the page and add it to a custom site definitions.

Second Try : I copied Header.ascx file to \TEMPLATE\LAYOUTS\1033 directory and then in STS-->default.aspx page, I added a Register Tagprefix with src="Header.ascx", but got the error message Could not find a part of the path "...\1033\STS\Header.ascx".

Please suggest me the exact location of header.ascx file and exact entry in default.aspx file?



4 Answers Found

Answer #1    Answered By: Keenan Whitehead     Answered On: Nov 08

Don't get me wrong, but I bet you could have found this article just as easily from MS's site.


If you do a little find  action, or scroll down, you'll see "/_layouts/1033/" refers to \templates\layouts\1033.

Answer #2    Answered By: Gopal Jamakhandi     Answered On: Nov 08

I've done the same through a custom  control; step-by-step
instructions below for deploying it to your site  def. I wonder if the
person replying understood your question; clearly you already know
something about site definitions  and where to find  them on the file

Yes, customizing the header  is messier than it should be in the
current version. Here are the steps required once you've got a
control that spits out HTML:

Towards the top  of default.aspx in my custom site definition, I have
registered the control  with a line like this:

<%@ register  Tagprefix="CramerNetCtrl"
Assembly="Cramer.SharePoint.CramerNetControls, Version=,
Culture=neutral, PublicKeyToken=zzzzzzzzzzzz" %>

... then the first row of the page  table contains an entry  like this:

<CramerNetCtrl:CramerNetHeaderControl id="CramerNetHeader1"
runat="server" />

Finally, web.config must have a trust entry such as

<SafeControl Assembly="Cramer.SharePoint.CramerNetControls,
[....] PublicKeyToken=zzzzzzzzzzzz"
Namespace="Cramer.SharePoint.CramerNetControls" TypeName="*"
Safe="True" />

This is the best way I know of to customize the header. Mine spits
HTML to render  logo and a toolbar, with a couple different options
depending on context.

The big drawback (and it's quite annoying) is that to make this
universal you would have to also customize all of the various pages
the _layouts folder that are not part  of the site definition.
(Unfortunately, search and replace  is not an option as they are
in a number of ways) This is true for any site definition mods, but I
have avoided touching the _layout pages, because of the effort to
and maintain the changes (patches will likely destroy your
customizations there). This means that some features, like the
rendered by my header control as well as an absolutely-aligned DHTML
utility layer that's also in my site def are available on most of my
portal pages but not found on any of the _layout pages like "upload
document". It's a bit confusing for users and I'm really hoping that
V3 addresses this using the parent page feature of .NET2 that I've
heard about.

High-touch customization is far too difficult and messy in the
version, as if a company spends a bundle deploying a corporate portal
they will naturally want it properly branded.

Answer #3    Answered By: Dameon Dejesus     Answered On: Nov 08

I was able to figure out to add  a user  control.

Deal is to save the .ascx file  in virtual server. Example inetpub\wwwroot\bin and then in default.aspx file registration setting must be Tagprefix="************" Tagname="Header" src="/bin/header.ascx".

And that's correct customization is too messy, I'm still not able to figure out which files do I need to add the user control. It's so messy. Probably I'll add within the custom site  definitions.

Answer #4    Answered By: Tejaswani Barve     Answered On: Nov 08

Article posted http://heathersolomon.com/blog/articles/159.aspx that lists the templates and what they are used for. You should find  this very helpful for picking and choosing what templates you want to include the custom header  on.

Didn't find what you were looking for? Find more on Header User Control on every page. Or get search suggestion and latest updates.