There is a search panel. The panel contains 2 input types ie. Keyword and category. There is one button.
When i enter only a keyword suppose say keyword AUTO and clicked on search,it redirects to the searchmain.aspx page and it searches the keyword AUTO of all categories. When i enter only cateory suppose say Automotive and clicked on search,it redirects to the searchcat.aspx page and it seraches the category.
i want in such a way that when user enter both keyword and category,it searches for the word in a selected category.
Link: http://alpha.dubaiexporters.com/Default.aspx
protected void doit(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(txtkeyword.Value))
{
try
{
String mainsearch1 = null;
String cat = null;
// mainsearch1 = txtserach.Text.Trim();
mainsearch1 = txtkeyword.Value.Trim();
if (mainsearch1.Length > 2)
{
Response.Redirect("searchmain.aspx?mainsearch=" + mainsearch1 + "&querylevel=1");
}
}
catch (Exception ex)
{
}
}
else if (!string.IsNullOrEmpty(txtserach.Value))
{
try
{
String cat = null;
// mainsearch1 = txtserach.Text.Trim();
cat = txtserach.Value.Trim();
if (cat.Length > 2)
{
//Response.Redirect("searchcat1.aspx");
Response.Redirect("searchcat1.aspx?cat=" + cat);
}
}
catch (Exception ex)
{
}
}
}
}