Step 1: Add a MasterPage with asp:label or asp:textbox like shown below..
<%@ Master Language="C#" ClassName="MyMaster" AutoEventWireup="true" CodeFile="MainMaster.master.cs" Inherits="MainMaster" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link runat="server" rel="shortcut icon" href="~/Images/favicon.ico" type="image/x-icon" />
<link runat="server" rel="icon" href="~/Images/favicon.ico" type="image/ico" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<div class="Header" style="width: 100%">
<div class="Title">
Test
</div>
<div>
<asp:Label ID="Query" runat="server"></asp:Label>
</div>
</div>
<asp:ContentPlaceHolder ID="BodyContentPlaceHolder" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
Step 2: In the code behind page set values to above labels or textboxes in the page_load event as shown below
...
protected void Page_Load(object sender, EventArgs e)
{
Query.Text = "Your Text";
}
...
Step Additional: Now if you want to add the data to each page request as querystring you may add the following code to the page_load event of the masterpage..
...
protected void Page_Load(object sender, EventArgs e)
{
Query.Text = "Your Text";
if (!IsPostBack)
{
validatePath(this.Request.Url.AbsolutePath);
}
}
private void validatePath(string url)
{
Response.Redirect(url + "?query=" + Query.Text);
}
...