C# Code
public partial class FindMatch : System.Web.UI.Page
{
DAL dal = new DAL();
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Visiter"] == null)
{
Response.Redirect("LogIn.aspx");
}
Page.Header.Title = "Find Match";
}
protected void btn_search_Click(object sender, EventArgs e)
{
string[] str=txt_search.Text.Split(' ');
DataTable dt = dal.GetDataTable("FindmatchWithname '"+str[0]+"'");
for (int i = 1; i < str.Length; i++)
{
dt.Merge(dal.GetDataTable("FindmatchWithname '"+str[0]+"'"));
}
grd_searchresult.DataSource = dt;
grd_searchresult.DataBind();
}
protected void lbl_name_Command(object sender, CommandEventArgs e)
{
Session["Owner"] = e.CommandArgument.ToString();
Response.Redirect("VisitorHome.aspx");
}
}
No comments:
Post a Comment