[置顶] 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 ...
随机推荐
- (Deep) Neural Networks (Deep Learning) , NLP and Text Mining
(Deep) Neural Networks (Deep Learning) , NLP and Text Mining 最近翻了一下关于Deep Learning 或者 普通的Neural Netw ...
- hdu4374One hundred layer (DP+单调队列)
http://acm.hdu.edu.cn/showproblem.php?pid=4374 去年多校的题 今年才做 不知道这一年都干嘛去了.. DP的思路很好想 dp[i][j] = max(dp[ ...
- lightoj 1008
水题,开根号判断大致范围,再找即可. #include<cstdio> #include<cmath> #include<cstdlib> using namesp ...
- [转]NHibernate之旅(11):探索多对多关系及其关联查询
本节内容 多对多关系引入 多对多映射关系 多对多关联查询 1.原生SQL关联查询 2.HQL关联查询 3.Criteria API关联查询 结语 多对多关系引入 让我们再次回顾在第二篇中建立的数据模型 ...
- strtok
1. Int main(void) { char *tmp = NULL; Char *remotebuf=”0\r\n”; tmp = strtok(remotebuf, DELIM); ...
- 1到n数组,和为指定数所有序列问题
(1)方法一,背包问题解法 #include <iostream> using namespace std; #include <vector> #include <li ...
- jsf服务器端验证用户输入
服务器端验证用户输入数据步骤 1 html页面上插入要输入数据控件 <h:inputText size="10" value="#{commodityBean.fo ...
- Shell脚本编程总结及速查手册
Shell是一种编程语言, 它像其它编程语言如: C, Java, Python等一样也有变量/函数/运算符/if语句/循环控制/… 但在开始之前, 我想先理清Shell语言与Shell之间的关系. ...
- PC-信使服务之不用聊天软件也能通信
net send 192.168.1.2 OK 二台电脑都要开启messenger服务.
- Block介绍(二)内存管理与其他特性
我们在前一章介绍了block的用法,而正确使用block必须要求正确理解block的内存管理问题.这一章,我们只陈述结果而不追寻原因,我们将在下一章深入其原因. 一.block放在哪里 我们针对不同情 ...