| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 474 人关注过本帖
标题:求dataslit 写了时间 怎么不管用啊
只看楼主 加入收藏
liuyahui
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2010-11-16
结帖率:33.33%
收藏
已结贴  问题点数:10 回复次数:3 
求dataslit 写了时间 怎么不管用啊
<asp:DataList ID="DataList1" runat="server">
               <ItemTemplate>
                 <table border="0" cellspacing="0" cellpadding="0" width="100%">
                     <tr>
                         <td>
                              <img src="../imgslogo/<%# Eval("logoimg") %>" />
                         </td>
                         <td>
                              <div class="div2_1"><span class="font_1"><asp:Label ID="Label2" runat="server" Text='<%# Bind("producename") %>'></asp:Label></span></div>
                         </td>
                         <td>
                            <div class="div2_1" ><span class="font_2">飞机:<asp:Label ID="Label3" runat="server" Text='<%# Bind("airprice") %>'></asp:Label></span></div>     
                         </td>
                         <td>
                            <div class="div2_1" ><span class="font_2">轮船:<asp:Label ID="Label4" runat="server" Text='<%# Bind("steamerprice") %>'></asp:Label></span></div>
                         </td>
                         <td>
                          <div class="div2_1" ><span class="font_2">火车:<asp:Label ID="Label5" runat="server" Text='<%# Bind("trainprice") %>'></asp:Label></span></div>
                         </td>
                        <td>
                          <div class="div2_1"><span class="font_2">汽车:<asp:Label ID="Label1" runat="server" Text='<%# Bind("carprice") %>'></asp:Label></span></div>
                         </td>
                        <td>
                         <div class="div2_1"><span class="font_2">保期:<asp:Label ID="Label7" runat="server" Text='<%# Bind("limit") %>'></asp:Label>天</span></div>
                       </td>
                       <td>
                          <div class="div2_1"><span class="font_2">会员价:<asp:Label ID="Label8" runat="server" Text='<%# Bind("distprice") %>'></asp:Label></span></div>
                       </td>
                       <td>
                        <%-- <div class="div2_1" ><a href="input_form.html" target="main"><img src="../images/ins/2index_15.jpg" style="position:relative; border:0;top:12px"></a></div>--%>
                        <asp:Button ID="Button1" runat="server" Text="Button"
                              onclick="Button1_Click" />
                       </td>
                     </tr>
                 </table>
               </ItemTemplate>
               
           </asp:DataList>


 protected void Button1_Click(object sender, EventArgs e)
        {
            string  proname=(DataList1.FindControl("Label2") as Label).Text.Trim();
            Response.Write(proname);
        }
搜索更多相关主题的帖子: dataslit 时间 
2010-12-01 11:09
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:3 
string  proname = Label2.Text.Trim();
Response.Write(proname);

本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2010-12-01 12:28
kevintang
Rank: 4
等 级:业余侠客
威 望:9
帖 子:799
专家分:236
注 册:2008-2-14
收藏
得分:3 
楼上的!模板里面可以直接 这样得到控件的值吗!
string  proname = Label2.Text.Trim();
Response.Write(proname);



编程少年基地——少年编程者的练兵场
http://bcsn.    招聘版主中

2010-12-01 13:49
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:4 
没细看,只是看到他的html代码里每个id都不一样

楼主,把你的问题说的详细点,写了什么时间不管用??

本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2010-12-01 20:32
快速回复:求dataslit 写了时间 怎么不管用啊
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.034236 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved