[置顶] Datalist嵌套datalist,页面传值,加密,数据绑定
<asp:DataList ID="dlMajor" runat="server" CssClass="dllist" OnItemDataBound="dlMajor_ItemDataBound">
<ItemTemplate>
<div class="div_major">
<%#Eval("major_name")%>
<asp:HiddenField ID="hf_major" runat="server" Value='<%#Eval("major_url") %>'></asp:HiddenField>
</div>
<asp:DataList ID="dlClass" runat="server" CssClass="dllist" OnItemDataBound="dlClass_ItemDataBound">
<ItemTemplate>
<div class="div_class">
<%#Eval("class_name")%>
<asp:HiddenField ID="hf_class" runat="server" Value='<%#Eval("class_url") %>'></asp:HiddenField>
</div>
<ul>
<asp:DataList ID="dlStudent" runat="server" CssClass="dllist" OnItemDataBound="dlClass_ItemDataBound">
<ItemTemplate>
<li>
<div class="num left">
<%#Eval("id")%>、</div> <%#new checkFiles.common.utils().GetInfo(Eval("student_url").ToString())%>
</div>
</li>
</ItemTemplate>
</asp:DataList>
</ul>
</ItemTemplate>
</asp:DataList>
</ItemTemplate>
<FooterTemplate>
<%-- <%if(dlMajor.Items.Count<=0) %>--%>
</FooterTemplate>
</asp:DataList>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using checkFiles.common; namespace checkFiles
{
public partial class center : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string path = "";
if (Request.QueryString["path"] != null && Request.QueryString["path"].ToString().Trim().Length > 0)
{ path = Server.HtmlDecode((Request.QueryString["path"].ToString().Trim())); } if (!IsPostBack)
{
utils util = new utils();
dlMajor.DataSource = util.GetMajorName(path);
dlMajor.DataBind();
if (dlMajor.Items.Count <= 0)
{
this.Panel1.Visible = true;
}
else
{
this.Panel1.Visible = false; }
} }
protected void dlMajor_ItemDataBound(object sender, DataListItemEventArgs e)
{ utils util = new utils(); HiddenField hf_major = (HiddenField)e.Item.FindControl("hf_major");
if (hf_major != null)
{ string path = hf_major.Value.ToString();
if (e.Item.ItemType == ListItemType.EditItem || e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
DataList dlClass = (DataList)e.Item.FindControl("dlClass");
dlClass.DataSource = util.GetClassName(path);
dlClass.DataBind();
} }
}
protected void dlClass_ItemDataBound(object sender, DataListItemEventArgs e)
{ utils util = new utils(); HiddenField hf_class = (HiddenField)e.Item.FindControl("hf_class");
if (hf_class != null)
{ string path = hf_class.Value.ToString();
if (e.Item.ItemType == ListItemType.EditItem || e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
DataList dlStudent = (DataList)e.Item.FindControl("dlStudent");
dlStudent.DataSource = util.GetStudentName(path);
dlStudent.DataBind();
}
}
}
}
}
[置顶] Datalist嵌套datalist,页面传值,加密,数据绑定的更多相关文章
- ASP.NET-DataList控件-DataList嵌套
DataList是ASP.NET的数据控件之一,在使用时要对其进行数据绑定.但是使用过程中难免会出现需要根据已绑定表中的某列数据来作进一步的查询和显示,就需要使用DataList嵌套来解决此类问题. ...
- 在UWP中页面滑动导航栏置顶
最近在研究掌上英雄联盟,主要是用来给自己看新闻,顺便copy个界面改一下段位装装逼,可是在我copy的时候发现这个东西 当你滑动到一定距离的时候导航栏会置顶不动,这个特性在微博和淘宝都有,我看了@ms ...
- Javascript笔记----实现Page页面右下角置顶按钮.
从用博客开始,发现博客园中很多博友的博客中在Page右下角都有个图标,不论屏幕怎么拉伸,都始终停留在右下角.点击后页面置顶.后面想想写一个Demo来实现这种效果吧. 一. 图标右下角固定. 1.SS ...
- DataList嵌套绑定例子
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DataList控件.asp ...
- ECSHOP任意页面显示指定分类、数量、排序的任意类型文章,包括只显示置顶or普通的文章
1.在需要使用此功能的PHP页面里最后的?>前面添加以下代码,现在以article.php为例子 /** jinmozhe 专业ECSHOP二次开发 * 获得指定分类ID.文章类型.指定数量.排 ...
- vue 移动端项目切换页面,页面置顶
之前项目是pc端是使用router的方式实现置顶的 //main.js router.afterEach((to, from, next) => { window.scrollTo(0, 0) ...
- iframe嵌套的页面之间传值问题
项目中很多时候会遇到需要用 iframe 嵌套页面的情况.有时候会有这样的需求: iframe 嵌套的页面 A ,点击之后要跳到页面 B ,但是同时还需要 A 页面中的某个属性值. 此时可以先把 A ...
- MVC中页面传值方式总结
MVC中的页面传值,通常指Controller和view之间的数据传递,经常用到的有几种方式,总结如下: 一.Controller----------->View(控制器传到视图) 1.View ...
- [置顶] IIS应用程序池多工作进程设置及Session共享
[置顶] IIS应用程序池多工作进程设置及Session共享 在调优iis的时候,朋友分享给我一个特别棒的设置方法步骤,感谢好朋友的分享. IIS应用程序池多工作进程设置及Session共享 1 ...
随机推荐
- Wordpress prettyPhoto插件跨站脚本漏洞
漏洞名称: Wordpress prettyPhoto插件跨站脚本漏洞 CNNVD编号: CNNVD-201311-413 发布时间: 2013-11-28 更新时间: 2013-11-28 危害等级 ...
- POJ2104 区间第k小
题意就是区间第k大…… 题解: 前段时间用主席树搞掉了…… 如今看到划分树,是在想来写一遍,结果18号对着学长的代码调了一上午连样例都没过,好桑心…… 今天在做NOI2010超级钢琴,忽然发现用划分树 ...
- [转] Manacher算法详解
转载自: http://blog.csdn.net/dyx404514/article/details/42061017 Manacher算法 算法总结第三弹 manacher算法,前面讲了两个字符串 ...
- 谈谈分布式事务之三: System.Transactions事务详解[下篇]
在前面一篇给出的Transaction的定义中,信息的读者应该看到了一个叫做DepedentClone的方法.该方法对用于创建基于现有Transaction对 象的“依赖事务(DependentTra ...
- [codevs]失恋28天题目系列
失恋28天-追女孩篇 题目描述 Description 呵呵,相信大家失恋33天都看过吧,里面的主人公黄小仙和王小贱都有印象吧!这回我要给大家讲的是我 们班同学的失恋经历,呵呵他总共失恋了28天.但是 ...
- [CODEVS1048]石子归并
时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 Description 有n堆石子排成一列,每堆石子有一个重量w[i], 每次合并可以合并相邻的两堆石子 ...
- C#学习:集合、迭代、泛型(1)
一.System.Collections名称空间下几个接口表征着集合的功能: 1.IEnumerable:表征着迭代功能 public interface IEnumerable { IEnumera ...
- Docker系列(一)安装
操作系统版本:Centos7 Docker版本:1.8 设置安装源 1 cat > /etc/yum.repos.d/docker.repo << -EOF 2 [dockerr ...
- Block介绍(一)基础
一.概述 Block是C级别的语法和运行时特性.Block比较类似C函数,但是Block比之C函数,其灵活性体现在栈内存.堆内存的引用,我们甚至可以将一个Block作为参数传给其他的函数或者Block ...
- 大型机汇编(mainframe assembler/HLASM)之COBOL解惑
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. ENVIRONMENT DIVISION. ...