易截截图软件、单文件、免安装、纯绿色、仅160KB

Asp.net DataList嵌套DataList的实现


Asp.net DataList嵌套DataList的实现
[ 2006-05-31 01:26:24 | 作者: Admin ]
字体大小: 大 | 中 | 小
数据服务控件的嵌套最主要的是是内层控件数据的加载和事件的触发。 DataList嵌套的重点是要在外层DataList的ItemDataBound事件中用e.Item.FindControl方法来找到嵌套层DataList的id,编写嵌套层DataList的绑定数据源事件。下面以两层DataList为例介绍下实现的过程。效果如下图:
---------前台html代码-------
<asp:datalist id="dlFileType" RepeatColumns="2" runat="server">
<ItemTemplate>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="22%" height="88" align="center" valign="top">
<img src='<%#DataBinder.Eval(Container.DataItem, "cnvcPicURL")%>' width="80" height="80">
</td>
<td valign="top">
<table width="96%" border="0" cellpadding="0" cellspacing="0">
<tr width="100%">
<td colspan="2"><img src='<%#PageBase.strStyleRoot+"/picture/pic_fwzn_08.gif"%>' height="20"><%#DataBinder.Eval(Container.DataItem, "cnvcTitle")%>
<asp:Label id="labFileType" runat="server" Visible=False Text='<%# DataBinder.Eval(Container.DataItem,"cniFileTypeID")%>'>
</asp:Label></td>
</tr>
<tr>
<td width="300">
<asp:DataList id="dlFileList" runat="server" RepeatColumns="1" Width="100%">
<ItemTemplate>
<TABLE cellSpacing="1" cellPadding="1" width="100%" border="0">
<tr>
<td width="7%" height="20" align="center">
<img src='<%#PageBase.strStyleRoot+"/picture/pic_fwzn_dot.gif"%>' width="3" height="3"></td>
<td width="93%">
<font color="#393939">
<%#GetTitle((string)Convert.ToString(DataBinder.Eval(Container.DataItem, "cnvcTitle")),(string)Convert.ToString(DataBinder.Eval(Container.DataItem, "cnvcFileType")),(string)Convert.ToString(DataBinder.Eval(Container.DataItem, "cniBaseFileID")),(DateTime)DataBinder.Eval(Container.DataItem, "cndtPublishTime"))%>
</font>
</td>
</


相关文档:

asp.net取文件夹中所有文件名

string[] files = Directory.GetDirectories(Server.MapPath("Themes/"));
先声明了一个字符数组,mapPath方法得到的是一个绝对路径。
因为GetFiles返回的是一个string[]数组,所以用 files来接收它。
然后我们在用一个foreach循环来遍历这个数组,取出所有值。
foreach (string file in files)
{
Response.W ......

JS与Asp.Net的传值

1. JS中取得Asp.Net的值
(1)取得服务端控件的值
var s = document.getElementById("TextBox1").value;   //取得TextBox1的Text值
(2)取得全局变量的值
在Page_Load()方法前定义protected String sT;
在Page_Load()方法中赋值sT = "哈哈";
JS中这样写取得
var s = "<%=sT %>";
-------------------- ......

asp.net 枚举 string字符串 转为汉字

   public static string TheColor(string color,string enumName)
        {
            return string.Format("<span style=\"color={0}\">{1}</span>",color,enumName);
     ......

ASP.NET Events

Here is the full list of all events that occur in an ASP.NET application, from the standard modules, to the page, master page, page controls and master page controls.
I have not included the IIS 7 specific events (Log, for example).
What
When
HttpApplication.BeginRequest
HttpApplication.Auth ......

.NET、ASP.NET控件及源码大汇总

.NET、ASP.NET控件及源码大汇总
作者:Allan_Green  来源:博客园  发布时间:2009-02-12 10:33  阅读:224 次  原文链接   [收藏]  
.NET、ASP.NET控件及源码大汇总
CuteEditor 6.0 在线HTML编辑器的领航者
ComponentArt.Charting.WebChart.dll
Comp ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号