---
title: "how to set title within content page"  
description: "how to set title within content page"  
author: "Anonymous User"  
published: 2014-08-27  
updated: 2014-08-27  
canonical: https://www.mindstick.com/forum/2166/how-to-set-title-within-content-page  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# how to set title within content page

I have created a [Content Page](https://www.mindstick.com/blog/258/set-property-value-on-master-page-from-content-page) using Master Page.

Within Master Page, I have created the following tag for [Title](https://www.mindstick.com/articles/12860/how-to-get-financing-for-salvage-title-cars):

```
<head id="Head1" runat="server">    <title></title>       <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />   </head>Within Content Page, following are set:   protected void Page_Load(object sender, EventArgs e){    if (!Page.IsPostBack)    {        if (String.IsNullOrEmpty(Request.QueryString["PatientRegistrationKey"]))        {           // ....        }        else        {            this.Page.Title = "My New Title";            //....        }    }
```

Though I am also setting the Master Page at run time as bellow:

```
 protected void Page_PreInit(Object sender, EventArgs e)    {        if (String.IsNullOrEmpty(Request.QueryString["PatientRegistrationKey"]))            this.MasterPageFile = "~/MasterPages/A.master";        else            this.MasterPageFile = "~/MasterPages/B.master";    }
```

[While getting](https://yourviews.mindstick.com/story/2272/here-are-the-risks-you-may-have-while-getting-a-tattoo) open this page in [browser](https://www.mindstick.com/blog/155254/which-is-the-best-internet-browser), I got following Title:

http://localhost:3562/?PatientRegistrationKey=0 - My New Title

Please [advice](https://yourviews.mindstick.com/view/50528/filament-advice-5-things-to-consider-before-you-buy-a-filament) for the changes, so that there should be only My New Title within title, nothing [extra](https://www.mindstick.com/blog/63570/5-ways-to-make-money-with-the-extra-space-in-your-home) like [query string](https://www.mindstick.com/articles/512/query-string-in-asp-dot-net) etc.

Any help would be appreciated.

## Replies

### Reply by Sumit Kesarwani

Hi Pravesh, \

If you don't set a default title on the page, the page will show the URL as the title. Go set the page title in the .aspx file:

<%@ Page Language="C#" MasterPageFile="..."

AutoEventWireup="true" Title="My Default Title" %>


---

Original Source: https://www.mindstick.com/forum/2166/how-to-set-title-within-content-page

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
