using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Search : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string str="";
        string type = "";
        type = Request["type"].ToLower();    
        string Path = Request.PathInfo.ToString();
        if (Request.QueryString.ToString() != "")
        {
            str = Request.QueryString.ToString();
        }
        if (Request.Form.ToString() != "")
        {
            str = Request.Form.ToString();
        }
        //str = Path.Substring(Path.IndexOf("?")+1);
        //type = type.Substring(type.LastIndexOf('/') + 1);
        //this.Response.Write(str);
        if(type.Contains("news"))
        {
            Server.Transfer("SearchNews.aspx?" + str, true);  
        }
        else if (type.Contains("purchase"))
        {
             Server.Transfer("SearchPurchase.aspx?" + str, true); 
        }
        else if (type.Contains("company"))
        {
             Server.Transfer("SearchCompany.aspx?" + str, true); 
        }
        else if (type.Contains("expo"))
        {
            Server.Transfer("SearchExpo.aspx?str=" + str, true);
        }
        else 
        {
            Server.Transfer( "SearchSupply.aspx?" + str, true); 
        }          
        
    }

}
