[置顶] 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 ...
随机推荐
- git checkout
git checkout <branch_name> <file> 检出具体分支上的 具体文件 git checkout --merge <branch_ ...
- WPF手写代码配置文件——单例
public class SettingHelper { //WPF下配置文件路径 public static readonly string SettingFilePath = AppDomain. ...
- [Bhatia.Matrix Analysis.Solutions to Exercises and Problems]ExI.1.3
Use the QR decomposition to prove Hadamard's inequality: if $X=(x_1,\cdots,x_n)$, then $$\bex |\det ...
- ReaderWriterLock类(转)
ReaderWriterLock类 通常来讲,一个类型的实例对于并行的读操作是线程安全的,但是并行地更新操作则不是(并 行地读和更新也不是). 这对于资源也是一样的,比如一个文件.当保护类型的实例安全 ...
- python获取当前路径几种方式
__python中操作路径,最好用绝对路径.__这样会避免在多个脚本调用过程中或不同层级调用过程中出现混乱 os.getcwd() sys.argv[0] or sys.path[0] __file_ ...
- 快速、冒泡排序算法(PHP版)
1.冒泡排序算法改进: 方法一: function bubbleSort($arr){//$arr(1...n)是待排序的文件,采用自下向上扫描,对$arr做冒泡排序 $bFlag = true; / ...
- 除去重复记录distinct
在查询数据库时候,可以使用distinct关键字过滤重复记录 例如 SELECT distinct ShiftID FROM [AdventureWorks].[HumanResources].[Em ...
- 算法导论学习-heapsort
heap的定义:如果数组a[1,....n]满足:a[i]>a[2*i] && a[i]>a[2*i+1],1<=i<=n/2,那么就是一个heap,而且是ma ...
- url 编码方法
这个方法用于把 字符串转换成url 的编码 第一个参数是 字符串,第二个参数是 指定的编码(UTF-8 ,GBK, gbk2312...) private string UrlEncode(strin ...
- eas bos 编辑界面 editUIt 属性值为空
在编辑界面,我们可以正常的保存某个值到数据库,同时列表界面也可以正常显示. 但是当我们再次打开这个编辑界面的时候,该属性值缺无法显示. 通常情况下,通过下面两个方法可以解决 方法一: 在编辑界面重写一 ...