public List <DtoUserTagSubscription> GetUserTagSubscription(Int64 UserID, string TagName) { command = new SqlCommand(StoredProcedure.Names.spGetUserTagSubscription.ToString(), connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@UserID", SqlDbType.BigInt); command.Parameters.Add("@TagName", SqlDbType.VarChar); command.Parameters[0].Value = UserID; command.Parameters[1].Value = TagName; lstUserTagSubscription = new List <DtoUserTagSubscription>(); connection.Open(); datareader = command.ExecuteReader(); if (!datareader.HasRows) { return(null); } while (datareader.Read()) { UserTagSubscription = new DtoUserTagSubscription(); UserTagSubscription.TagId = Convert.ToInt64(datareader["TagId"].ToString()); UserTagSubscription.UserSubscriptionId = Convert.ToInt64(datareader["UserTagSubscriptionId"]); UserTagSubscription.TagName = (datareader["TagName"]).ToString(); lstUserTagSubscription.Add(UserTagSubscription); } connection.Close(); return(lstUserTagSubscription); }
protected void DatalistLinkTag_ItemDataBound(object sender, DataListItemEventArgs e) { try { var lteral = (Literal)e.Item.FindControl("ltrltags"); var ltrlbtn = (Literal)e.Item.FindControl("ltrlbtn"); var btnBtmTagFollow = (HtmlInputButton)e.Item.FindControl("BtnTagUnFollow"); _dtoUserTagSubscription = new DtoUserTagSubscription(); _dtoUserTagSubscription = (DtoUserTagSubscription)e.Item.DataItem; ltrlbtn.Text += "<input type='button' id='BtnTagUnFollow" + _dtoUserTagSubscription.TagId + "' runat='server' style=' width:100px; ' onclick='DeleteUserTagSubscription("" + _dtoUserTagSubscription.TagId + "")' class='simplebutton' value='UnFollow Tag' />"; lteral.Text += "<a id='" + _dtoUserTagSubscription.TagName + "-" + _dtoUserTagSubscription.TagId + "' class='post-tag' >" + _dtoUserTagSubscription.TagName + "</a>"; } catch (Exception ex) { ex.ToExceptionless().Submit(); } }