示例#1
0
        public void sortBind()
        {
            var list = new NewsSortMgr().Select();

            ddlSort.Items.Add("全部");
            foreach (var item in list)
            {
                var listItem = new ListItem(item.NewsSortName, item.ID.ToString());
                ddlSort.Items.Add(listItem);
            }
        }
示例#2
0
        public void newsBind()
        {
            var           list = new NewsSortMgr().Select();
            StringBuilder aa   = new StringBuilder();

            foreach (var i in list)
            {
                var href = "NewsTitle.aspx?id=" + i.ID;
                aa.AppendLine("<li>" + "<a href='" + href + "'>" + i.NewsSortName + "</a>" + "</li>");
                sortList.InnerHtml = aa.ToString();
            }
        }
示例#3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string sortName = Convert.ToString(context.Request["SortName"]);

            NewsSort model = new NewsSort
            {
                NewsSortName = sortName
            };

            var newsList = new NewsSortMgr().Select2(model);

            string jsonStr = new JavaScriptSerializer().Serialize(newsList);

            context.Response.Write(jsonStr);
        }