2 using System
.Collections
.Generic
;
6 using System
.Web
.UI
.WebControls
;
8 public partial class _Default
: System
.Web
.UI
.Page
10 protected void Page_Load(object sender
, EventArgs e
)
12 string searchMask
= Request
.QueryString
["q"];
13 if (!String
.IsNullOrEmpty(searchMask
))
19 ListView1
.DataSource
= null;
24 protected void Search(string searchMask
)
26 SearchEngine se
= new SearchEngine();
27 ListView1
.DataSource
= se
.Search(searchMask
);
31 protected void btnSearch_Click(object sender
, EventArgs e
)
33 if (!String
.IsNullOrEmpty(this.TextBox1
.Text
))
34 Response
.Redirect(String
.Format("~/Default.aspx?q={0}", this.TextBox1
.Text
));
37 protected override void OnInit(EventArgs e
)
40 if (this.IsPostBack
&& (Request
.Params
["__EVENTTARGET"] == btnSearch
.UniqueID
))
41 Response
.Redirect("~/Default.aspx?q=" + this.Server
.UrlEncode(Request
.Params
[TextBox1
.UniqueID
]));