Hi nedash,
I have created sample code which fullfill your requirement.
HTML
Default.aspx
<div>
<asp:TextBox ID="txtsearch" runat="server" />
<asp:Button ID="btnSubmit" OnClick="OnClick" Text="Image" runat="server" />
</div>
C#
protected void OnClick(object sender, EventArgs e)
{
Response.Redirect("Search/" + txtsearch.Text.Trim());
}
Search.aspx
<div>
<asp:Label ID="lblSearchText" runat="server" />
</div>
C#
protected void Page_Load(object sender, EventArgs e)
{
lblSearchText.Text = this.Page.RouteData.Values["SearchText"].ToString();
}
Global.asax
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(System.Web.Routing.RouteTable.Routes);
}
static void RegisterRoutes(System.Web.Routing.RouteCollection routes)
{
routes.MapPageRoute("Search", "Search/{SearchText}", "~/Search.aspx");
}
Web.config
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
</system.web>
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true"/>
</security>
</system.webServer>
</configuration>
Screenshot