protected void Page_Load(object sender, EventArgs e) { zoneCurrent = ZoneUtility.GetZoneCurrent(); var source = ZoneDB.GetByParentID(zoneCurrent); if (source.Rows.Count == 0) { var zoneparent = ZoneDB.GetParentID(zoneCurrent); if (zoneparent != 0) { source = ZoneDB.GetByParentID(zoneparent); } } rptData.DataSource = source; rptData.DataBind(); }
protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { var curData = (DataRowView)e.Item.DataItem; var lnkZone = (HyperLink)e.Item.FindControl("lnkZone"); var imgAvatar = (Image)e.Item.FindControl("imgAvatar"); if (curData["Zone_ID"].ToString() == _zoneCurrent.ToString() || curData["Zone_ID"].ToString() == ZoneDB.GetParentID(_zoneCurrent).ToString() || curData["Zone_ID"].ToString() == ZoneDB.GetParentID(ZoneDB.GetParentID(_zoneCurrent)).ToString()) { lnkZone.CssClass = "selected"; imgAvatar.Attributes.Add("style", "position: relative; z-index: 100;"); } if (_zoneCurrent == 0) { if (curData["Zone_ID"].ToString() == _zoneHome.ToString()) { lnkZone.CssClass = "selected"; imgAvatar.Attributes.Add("style", "position: relative; z-index: 100;"); } } if (curData["Zone_RealUrl"].ToString().Length > 0) { lnkZone.NavigateUrl = curData["Zone_RealUrl"].ToString(); } else { lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(ConvertUtility.ToInt32(curData["Zone_ID"])); } //lnkZone.Text = curData["Zone_Name"].ToString(); var avatar = curData["Zone_Avatar"].ToString().Trim(); if (avatar.Length > 0) { imgAvatar.ImageUrl = avatar; } else { imgAvatar.Visible = false; lnkZone.Text = curData["Zone_Name"].ToString(); } } }
protected void rptSub2_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { var curData = (DataRowView)e.Item.DataItem; var lnkSub2 = (HyperLink)e.Item.FindControl("lnkSub2"); //Repeater rptSub3 = (Repeater)e.Item.FindControl("rptSub3"); if (curData["Zone_ID"].ToString() == _zonecurrent.ToString() || curData["Zone_ID"].ToString() == ZoneDB.GetParentID(_zonecurrent).ToString()) { lnkSub2.Font.Underline = true; } //if (zoneCurrent == 0) //{ // if (curData["Zone_ID"].ToString() == zoneHome.ToString()) lnkSub2.CssClass = "selected"; //} lnkSub2.Text = curData["Zone_Name"].ToString(); if (curData["Zone_RealUrl"].ToString().Length > 0) { lnkSub2.NavigateUrl = curData["Zone_RealUrl"].ToString(); } else { lnkSub2.NavigateUrl = UrlFilter.BuildUrlByZoneID(ConvertUtility.ToInt32(curData["Zone_ID"])); } //DataTable dtSub = ZoneDB.GetByParentID(ConvertUtility.ToInt32(curData["Zone_ID"])); //if (dtSub.Rows.Count == 0) //{ // rptSub3.Visible = false; //} //else //{ // rptSub3.DataSource = dtSub; // rptSub3.ItemDataBound += new RepeaterItemEventHandler(rptSub3_ItemDataBound); // rptSub3.DataBind(); //} } }