public void URLParameterSetup() { tag = Request.QueryString["g"]; string strPage = Request.QueryString["p"]; keyword = Request.QueryString["search"]; exactKeyword = Request.QueryString["esearch"]; withoutKeyword = Request.QueryString["wsearch"]; atLeastKeyword = Request.QueryString["asearch"]; string category = Request.QueryString["cat"]; string sortOrder = Request.QueryString["to"]; searchType = Request.QueryString["type"]; page = 1; Int32.TryParse(strPage, out page); // set the page to 1 if no preference is found in the URL page = (page == 0) ? 1 : page; categoryId = -1; if (!string.IsNullOrEmpty(category)) { Int32.TryParse(category, out categoryId); } order = OrderVideo.Latest; try { order = (OrderVideo)int.Parse(sortOrder); } catch { } }