zoukankan      html  css  js  c++  java
  • Repeater后台取前台textbox值

    <asp:HiddenField ID="hfValues" runat="server" /> 

     <table class="li_Tb">
                <tr>
                    <td width="5%">
                        名称
                    </td>
                    <td width="8%">
                        原有顺序
                    </td>
                    <td width="5%">
                       更改顺序
                    </td>
                    <td width="5%">
                        更改
                    </td>
                </tr>

    <asp:Repeater ID="rptProductList" runat="server" OnItemCommand="rptProductList_ItemCommand">

                    <ItemTemplate>
                        <tr>
                            <td>
                                <%#Eval("Name_CH")%>
                            </td>
                            <td>
                                <%# Eval("SortOrder")%>
                            </td>
                            <td>
                                <%# "<input type='text'  id='txtRanking" + Eval("SeqNo") + "' />"%>
                            </td>
                            <td>
                                <asp:Button ID="btnRanking" OnClientClick='<%#Eval("SeqNo","javascript:return assignment({0});")%>'
                                    runat="server" Text="修改" CommandArgument='<%#Eval("SeqNo")%>' CommandName="Edit" />
                            </td>
                        </tr>
                    </ItemTemplate>

                </asp:Repeater>

      </table>

    <script type="text/javascript">

             var hfValues = document.getElementById("ContentPlace_hfValues");
             
             function assignment(id) {
                 var txtRanking = document.getElementById("txtRanking" + id);
                 if (txtRanking.value != "") {
                     hfValues.value = txtRanking.value;
                     return true;
                 } else {
                     alert("更改顺序不能为空!");
                     return false;
                 }
                 return false;
             }

        </script> 

  • 相关阅读:
    Pandas to_sql将DataFrame保存的数据库中
    Pandas 的groupby操作
    Hibernate(一)
    EasyUI
    Java面试题
    Solr
    Lucene
    SpringMVC(二)
    MyBatis(二)
    MyBatis(一)
  • 原文地址:https://www.cnblogs.com/YSO1983/p/1851633.html
Copyright © 2011-2022 走看看