hi
in default.aspx are textbox and imagebutton that user type text in text box and click on button then it will go to search.aspx page and in searxch.aspx page is textbox that will show typed text that users enter in default.aspx in text box:
Default.aspx Code:
protected void Imgsearch_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("search.aspx?data=" + Server.UrlEncode(Txtsearch.Text));
}
Search.aspx Code:
if (!this.IsPostBack)
{
Txtsearch.Text = Request.QueryString["data"].ToString();
}
now I want use urlrouting for it so I change code like:
Default.aspx:
protected void Imgsearch_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Search/" + Server.UrlEncode(Txtsearch.Text));
}
and global.asax:
static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("Searchinfo", "Search/{UrlName}", "~/search.aspx");
but I don't know how I can change below code:
search.aspx
if (!this.IsPostBack)
{
Txtsearch.Text = Request.QueryString["data"].ToString();
}
Best Regards
Neda