<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,页面传值,加密,数据绑定的更多相关文章

  1. ASP.NET-DataList控件-DataList嵌套

    DataList是ASP.NET的数据控件之一,在使用时要对其进行数据绑定.但是使用过程中难免会出现需要根据已绑定表中的某列数据来作进一步的查询和显示,就需要使用DataList嵌套来解决此类问题. ...

  2. 在UWP中页面滑动导航栏置顶

    最近在研究掌上英雄联盟,主要是用来给自己看新闻,顺便copy个界面改一下段位装装逼,可是在我copy的时候发现这个东西 当你滑动到一定距离的时候导航栏会置顶不动,这个特性在微博和淘宝都有,我看了@ms ...

  3. Javascript笔记----实现Page页面右下角置顶按钮.

    从用博客开始,发现博客园中很多博友的博客中在Page右下角都有个图标,不论屏幕怎么拉伸,都始终停留在右下角.点击后页面置顶.后面想想写一个Demo来实现这种效果吧. 一. 图标右下角固定. 1.SS ...

  4. DataList嵌套绑定例子

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DataList控件.asp ...

  5. ECSHOP任意页面显示指定分类、数量、排序的任意类型文章,包括只显示置顶or普通的文章

    1.在需要使用此功能的PHP页面里最后的?>前面添加以下代码,现在以article.php为例子 /** jinmozhe 专业ECSHOP二次开发 * 获得指定分类ID.文章类型.指定数量.排 ...

  6. vue 移动端项目切换页面,页面置顶

    之前项目是pc端是使用router的方式实现置顶的 //main.js router.afterEach((to, from, next) => { window.scrollTo(0, 0) ...

  7. iframe嵌套的页面之间传值问题

    项目中很多时候会遇到需要用 iframe 嵌套页面的情况.有时候会有这样的需求: iframe 嵌套的页面 A ,点击之后要跳到页面 B ,但是同时还需要 A 页面中的某个属性值. 此时可以先把 A ...

  8. MVC中页面传值方式总结

    MVC中的页面传值,通常指Controller和view之间的数据传递,经常用到的有几种方式,总结如下: 一.Controller----------->View(控制器传到视图) 1.View ...

  9. [置顶] IIS应用程序池多工作进程设置及Session共享

    [置顶] IIS应用程序池多工作进程设置及Session共享   在调优iis的时候,朋友分享给我一个特别棒的设置方法步骤,感谢好朋友的分享. IIS应用程序池多工作进程设置及Session共享 1  ...

随机推荐

  1. APP-PER-50022: Oracle Human Resources could not retrieve a value for the User Type profile option.

    Symptoms ----------------------- AP > Setup > Organizations Show Error tips: APP-PER-50022: Or ...

  2. __cdecl、__stdcall、__fastcall、thiscall 进栈、出栈区别

    https://en.wikipedia.org/wiki/X86_calling_conventions https://msdn.microsoft.com/en-us/library/984x0 ...

  3. [原]H264帧内预测

    帧内预测模块大小 说明 4x4(亮度) 预测方式9种 8x8(亮度) 预测方式9种.只有high profile才有 16x16(亮度) 预测方式4种,只依赖左,上数据. 8x8(色度) 预测方式4种 ...

  4. bzoj 2285 [Sdoi2011]保密(二分,spfa + 最大流)

    Description 现在,保密成为一个很重要也很困难的问题.如果没有做好,后果是严重的.比如,有个人没有自己去修电脑,又没有拆硬盘,后来的事大家都知道了. 当然,对保密最需求的当然是军方,其次才是 ...

  5. POJ-3070Fibonacci(矩阵快速幂求Fibonacci数列) uva 10689 Yet another Number Sequence【矩阵快速幂】

    典型的两道矩阵快速幂求斐波那契数列 POJ 那是 默认a=0,b=1 UVA 一般情况是 斐波那契f(n)=(n-1)次幂情况下的(ans.m[0][0] * b + ans.m[0][1] * a) ...

  6. 使用Windows Azure创建Windows系统虚拟机-上

    创建虚拟机来运行Windows 本教程介绍了如何轻松创建运行Windows 的 Azure虚拟机(VM),用作来自Azure管理门户中映像图库的Windows 服务器映像.映像图库提供了多种图像,包括 ...

  7. Android webView 中loadData方法加载 带中文时出现乱码

    WebView出现乱码用LoadData方法来解析html的,但是据说这是官方的一个BUG,不能用来解析中文. 采用loadDataWithBaseURL的方法,其中codeingType设置为utf ...

  8. 改变SQL默认数据库的存储路径

    数据库默认路径保存在注册表里,我们可以通过xp_instance_regwrite来修改注册表,具体可以试试下面的方法: --1.更改資料文件默認存放路經:EXEC xp_instance_regwr ...

  9. SharePoint服务器将连接配置数据库的连接字符串保存在什么地方?

    经常有人问我这个问题,SharePoint服务器将连接配置数据库的连接字符串保存在什么地方?虽然其他SharePoint服务器场设置都是保存到了配置数据库里面,但连接配置数据库本身的连接字符串,肯定是 ...

  10. HDOJ-ACM1013(JAVA)

    这道题也很简单~主要是将输入转为字符串(存储大数,操作字符数组) 题意: 24 : 2 + 4 = 6  输出6 39 : 3 + 9 = 12 , 1 + 2 = 3 输出3 999: 9 + 9 ...