文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Repeater 控件获取单击行索引值

Repeater 控件获取单击行索引值

时间:2011-02-17  来源:共谱一曲

<asp:Repeater ID="rptUserList" runat="server">
                        <ItemTemplate>
                            <tr align="center">
                           
                           
                                <td>
                                    <%=RowIndex++ %>
                                </td>
                        
                                <td>
                               
                                <asp:HiddenField  ID="HideID" runat="server" Value='<%#Eval("PKID") %>' />
                                    <asp:LinkButton ID="lbtnPwdReset" runat="server"  OnClick="lbtnPwdReset_Click" class="lbtnBottom">[密码重置]</asp:LinkButton>
                                </td>
                                <td>
                                    <img alt="修改" src="http://www.cnblogs.com/Images/38.gif" />
                                </td>
                                <td>
                                    <img src="http://www.cnblogs.com/Images/16.gif" alt="删除" />
                                </td>
                            </tr>
                        </ItemTemplate>

//后台代码

//[重置密码]单击事件

 protected void lbtnPwdReset_Click(object sender, EventArgs e)
        {
            LinkButton bt = sender as LinkButton;
            RepeaterItem rptItem = bt.Parent as RepeaterItem;
            HiddenField pkid = rptItem.FindControl("HideID") as HiddenField;
      
            ClientScript.RegisterStartupScript(GetType(),"HaiLan","<script>alert('"+pkid.Value+"');</script>");
        }

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载