protected void Page_Load(object sender, EventArgs e) { try { //System.Diagnostics.Debugger.Launch(); IsUser(); if (!IsPostBack) { ViewState["TagId"] = 0; ViewState["EmoId"] = 0; _blluser = new BllUser(); Lstdtonewsfeed = new List <DtoNewsFeed>(); string[] items; if (Request.QueryString["TagId"] != null) { var tagarray = Request.QueryString["TagId"]; if (tagarray.Split(',').Length > 0) { items = tagarray.Split(','); for (int i = 0; i < (items.Length - 1); i++) { if (!(Convert.ToInt64(items[i]) > 0)) { ViewState["TagId"] = ""; // error SQL injection break; } } ViewState["TagId"] = Request.QueryString["TagId"]; } else { ViewState["TagId"] = Request.QueryString["TagId"]; } } else { ViewState["TagId"] = ""; } if (Request.QueryString["EmoId"] != null) { string emoarray = Request.QueryString["EmoId"]; if (emoarray.Split(',').Length > 0) { items = emoarray.Split(','); for (int i = 0; i < (items.Length - 1); i++) { if (!(Convert.ToInt64(items[i]) > 0)) { ViewState["EmoId"] = ""; // error SQL injection break; } } ViewState["EmoId"] = Request.QueryString["EmoId"]; } else { ViewState["EmoId"] = Request.QueryString["EmoId"]; } } else { ViewState["EmoId"] = ""; } if (ViewState["EmoId"].ToString().Length > 0) { ViewState["EmoId"] = ViewState["EmoId"].ToString().Remove(ViewState["EmoId"].ToString().Length - 1, 1); } if (ViewState["TagId"].ToString().Length > 0) { ViewState["TagId"] = ViewState["TagId"].ToString().Remove(ViewState["TagId"].ToString().Length - 1, 1); } Lstdtonewsfeed = _blluser.GetUserTagFeed(UserId, ViewState["TagId"].ToString(), ViewState["EmoId"].ToString(), 1, 10); } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }
protected void Page_Load(object sender, EventArgs e) { try { GetCookie(); if (!IsPostBack) { ViewState["tagid"] = 0; _bllwebsite = new BllWebsite(); _blltag = new BllTag(); _blluser = new BllUser(); if (Request.QueryString["PageNo"] != null) { _pageNumber = Convert.ToInt32(Request.QueryString["PageNo"]); } if (Request.QueryString["flow"] == "inlinecode") { if (Request.QueryString["Id"] != null) { ViewState["tagid"] = Convert.ToInt64(Request.QueryString["Id"]); } Lstdtonewsfeed = _blltag.GetTagNewsFeed(_userId, Convert.ToInt64(ViewState["tagid"]), _pageNumber, 40); } else if (Request.QueryString["flow"] == "wall") { Lstdtonewsfeed = _blluser.GetUserNewsFeed(_userId, _pageNumber, 40); } else if (Request.QueryString["flow"] == "profile") { if (Request.QueryString["TagId"] != null && Request.QueryString["EmoId"] != null) { var tagstr = Request.QueryString["TagId"]; var emostr = Request.QueryString["EmoId"]; Lstdtonewsfeed = _blluser.GetUserTagFeed(_userId, tagstr, emostr, _pageNumber, 10); } } else if (Request.QueryString["flow"] == "website") { if (Request.QueryString["TagId"] != null && Request.QueryString["EmoId"] != null && Request.QueryString["WebsiteId"] != null) { var tagstr = Request.QueryString["TagId"]; var emostr = Request.QueryString["EmoId"]; var websiteId = Convert.ToInt64(Request.QueryString["WebsiteId"]); Lstdtonewsfeed = _bllwebsite.GetWebsiteFeed(_userId, websiteId, tagstr, emostr, _pageNumber, 10); } } } } catch (Exception ex) { ex.ToExceptionless().Submit(); } }