怎样获取DataList中Label的值

ootwooo 2009-08-21 01:06:49
DataList中加入Label控件和ImageButton控件,当点击ImageButton后跳转到另外页面并且将Label的Text的值作为参数传到另一页面?小弟不知道怎么得到Label的Text的值,请大侠们指点迷津!!不胜感激!!
代码:

<asp:Panel ID="Panel3" runat="server" Height="854px">
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1"
onselectedindexchanged="DataList1_SelectedIndexChanged"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
CellPadding="3" CellSpacing="2" DataKeyField="productid" GridLines="Both"
Width="737px">
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<ItemStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<HeaderTemplate>
商品编号 商品名称       尺寸      售价         商品描述            <br />
<br />
</HeaderTemplate>
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("productid", "{0}") %>'></asp:Label>
      
<asp:Label ID="Label4" runat="server" Text='<%# Eval("productname", "{0}") %>'></asp:Label>
      
<asp:Label ID="Label7" runat="server" Text='<%# Eval("productsize", "{0}") %>'></asp:Label>
      
<asp:Label ID="Label6" runat="server" Text='<%# Eval("productprice", "{0}") %>'></asp:Label>
                   <asp:Label ID="Label9" runat="server"
Text='<%# Eval("description", "{0}") %>'></asp:Label>
                    <asp:Image ID="Image1" runat="server"
ImageUrl='<%# Eval("productimages") %>' />
                     <br />
     
<br />
<br />
<asp:Panel ID="Panel4" runat="server"
Height="32px" Width="107px">
<asp:ImageButton ID="ImageButton1" runat="server" CommandName="select"
ImageUrl="~/Images/shopping_cart.gif" onclick="ImageButton1_Click" />
</asp:Panel>

用Session 传值
...全文
405 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
阿非 2009-08-21
  • 打赏
  • 举报
回复
<asp:ImageButton ID="ImageButton1" runat="server" CommandName="select" 
CommandArgument='<%# Eval("productid") %>'
ImageUrl="~/Images/shopping_cart.gif" onclick="ImageButton1_Click" />


suano 2009-08-21
  • 打赏
  • 举报
回复
request.form[lable名]试试
Atai-Lu 2009-08-21
  • 打赏
  • 举报
回复
Label.Text

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧