<%@ Control Language="C#" ClassName="template" Inherits="Bitrix.UI.BXComponentTemplate" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="Bitrix" %>
<%@ Import Namespace="Bitrix.DataTypes" %>
<%@ Import Namespace="Bitrix.Services" %>

<script runat="server">
	public override string Title
	{
		get
		{
			return "Portal template";
		}
	}
	protected void Submit_Click(object sender, ImageClickEventArgs args)
	{
		BXParamsBag<object> p = new BXParamsBag<object>();
		p.Add("query", Query.Text);

		Component.ProcessCommand("search", p, new List<string>());
	}
</script>

<asp:Panel ID="Container" runat="server" CssClass="search-form" DefaultButton="Submit" >
	<span class="search-text">Search</span>
	<asp:TextBox runat="server" ID="Query" CssClass="search-field" />
	<% Submit.ImageUrl = ResolveUrl("images/search-button.gif"); %>
	<asp:ImageButton runat="server" ID="Submit" CssClass="search-submit" OnClick="Submit_Click" />
</asp:Panel>