我在内容放入了一个DataList,在 <ItemTemplate>下是将绑定的一机构表,我想在ItemTemplate中放入一个隐藏域,并且把值通过层的方式传入下一个页面。现在的代码
<asp:DataList ID="dlBrandsZhongXue" runat="server" RepeatColumns="8" RepeatDirection="horizontal"
OnItemDataBound="dlBrands_ItemDataBound">
<ItemTemplate>
<div runat="server" id="mainDiv">
<table id="item" runat="server">
<tr>
<td>
<!--我想在页面.aspx.cs中取出值,或者直接将值保存放入下级页面,谁来看看 -->
<asp:HiddenField ID="aa" runat="server" Value="why????出来" /> <a href="" >
<asp:Image ID="img" runat="server" ImageUrl='<%# "~/image/"+Eval("BrandPic")%>' Height="61px"
Width="103px" /></a>
</td>
<td>
<!--层这里 -->
<div id="divDetail" runat="server" style="display: none; width: 200px; height: 200px;
background-color: #FFCC00; position: absolute; z-index: 1">
<table id="Table1" runat="server" style="width: 200px; height: 200px;">
<tr>
<td align="center">
<span style="font-size: 13px; line-height: 20px">
<asp:HyperLink Text="机 构 概 览" NavigateUrl="~/LinkCommon/BrandSurvey.aspx" ID="h1Brank" runat="server"></asp:HyperLink></span>
</td>
</tr>
<tr>
<td align="center">
<span style="font-size: 13px; line-height: 20px;">
<asp:HyperLink Text="评 论 留 言" NavigateUrl="#" ID="hlRe" runat="server"></asp:HyperLink></span></td>
</tr>
<tr>
<td align="center">
<span style="font-size: 13px; line-height: 20px;">
<asp:HyperLink runat="server" NavigateUrl="#" ID="hlDiscoutedPrice" Text="报 名 优 惠"></asp:HyperLink>
</span>
</td>
</tr>
<tr>
<td align="center">
<span style="font-size: 13px; line-height: 20px;">
<asp:HyperLink Text="网 站 链 接" NavigateUrl="#" ID="hlWeb" runat="server"></asp:HyperLink></span></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</ItemTemplate>
</asp:DataList>
<asp:DataList ID="dlBrandsZhongXue" runat="server" RepeatColumns="8" RepeatDirection="horizontal"
OnItemDataBound="dlBrands_ItemDataBound">
<ItemTemplate>
<div runat="server" id="mainDiv">
<table id="item" runat="server">
<tr>
<td>
<!--我想在页面.aspx.cs中取出值,或者直接将值保存放入下级页面,谁来看看 -->
<asp:HiddenField ID="aa" runat="server" Value="why????出来" /> <a href="" >
<asp:Image ID="img" runat="server" ImageUrl='<%# "~/image/"+Eval("BrandPic")%>' Height="61px"
Width="103px" /></a>
</td>
<td>
<!--层这里 -->
<div id="divDetail" runat="server" style="display: none; width: 200px; height: 200px;
background-color: #FFCC00; position: absolute; z-index: 1">
<table id="Table1" runat="server" style="width: 200px; height: 200px;">
<tr>
<td align="center">
<span style="font-size: 13px; line-height: 20px">
<asp:HyperLink Text="机 构 概 览" NavigateUrl="~/LinkCommon/BrandSurvey.aspx" ID="h1Brank" runat="server"></asp:HyperLink></span>
</td>
</tr>
<tr>
<td align="center">
<span style="font-size: 13px; line-height: 20px;">
<asp:HyperLink Text="评 论 留 言" NavigateUrl="#" ID="hlRe" runat="server"></asp:HyperLink></span></td>
</tr>
<tr>
<td align="center">
<span style="font-size: 13px; line-height: 20px;">
<asp:HyperLink runat="server" NavigateUrl="#" ID="hlDiscoutedPrice" Text="报 名 优 惠"></asp:HyperLink>
</span>
</td>
</tr>
<tr>
<td align="center">
<span style="font-size: 13px; line-height: 20px;">
<asp:HyperLink Text="网 站 链 接" NavigateUrl="#" ID="hlWeb" runat="server"></asp:HyperLink></span></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</ItemTemplate>
</asp:DataList>
就这样取