SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using following code to create web part pages. I want to add the "title" of the page as well. I am not sure what would be the extra piece of code. My site is not a publishing site and I am not creating publishing pages just simple web part pages and adding web parts further through code only.

@"<?xml version=""1.0"" encoding=""UTF-8""?>
        <SetList Scope=""Request""><ListID></SetList>
        <SetVar Name=""ID"">New</SetVar>
        <SetVar Name=""Cmd"">NewWebPage</SetVar>
        <SetVar Name=""Type"">WebPartPage</SetVar>
        <SetVar Name=""WebPartPageTemplate""><Template></SetVar>
        <SetVar Name=""Title""><PageName></SetVar>
        <SetVar Name=""Overwrite"">True</SetVar>
share|improve this question

I would think you need to clarify your question as im kind confused at what your asking for? the page title in the webpart or the webpart title in the webpage or add a title on the page from the webpart? you also said Programmatically in c#? or SPD? or as a feature? lol sorry to be a pain :)

but if I have got you right it would be the third option and you said you want it in code only?

protected void Page_Load(object sender, EventArgs e)
    ITitleProvider titleProvider = AxBaseWebPart.GetWebpart(this) as ITitleProvider;

    // Specify the title to pass as the AxPageTitle
    titleProvider.Caption = "Page title goes here";

    // Do not include the context in the title
    titleProvider.ShowContext = false;

share|improve this answer
Ok Let me clarify it more. I am creating web part pages and adding my custom web parts at the same time on feature activation through the code I have listed. By default page name is taken as the Page Title. I am interested in setting the page title (text that appears on browser title bar). And all this should happen on feature activation.Hope it helps. – V.B Aug 17 '12 at 11:38
iv got some links for you to check out.… and this is hiding the title using css… – ali Sharepoint Aug 17 '12 at 12:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.