本文介绍了如何使用c#和javascript从转发器获取价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 < div > < ul class = ul-临床 样式 = margin-removed 5px; > < asp:Repeater ID = rptAllMembers runat = 服务器 > < ItemTemplate > < li class = ul_Clinical_li1 style = margin-removed 10px;保证金已移除15px; border:1px solid #ccc; 宽度:100px;高度:100px; önclick = clickshowtick('<% #Eval ( TherapistStaffID)%>') > < div id =' <% #Eval( TherapistStaffID )%>' class = > < / div > < img src = 。 ./images/Avatar.png\" alt = TimeSheet style = width:50px; / > < br / > < asp:标签 ID = lblUsername runat = server 工具提示 =' <% #Eval( FirstName)+ + Eval( LastName)%>' 文字 =' <% #Eval( FirstName)+ + Ev al( LastName)%>' > < / asp:Label > < / li > < / ItemTemplate > < / asp:Repeater > < / ul > < / div > 这是我执行的转发器jquery上的tick类和从我的table.in中获取id。在eval id =''<%#Eval(TherapistStaffID)%>'' < div class = DivGeneral > < asp:标签 ID = lblSearch runat = server 文字 = 搜索: 宽度 = 50px > < / asp:标签 > < asp:TextBox ID = txtSearch runat = server CssClass = sf 宽度 = 423px > < / asp:TextBox > <% - 隐藏字段 - %> < asp:HiddenField ID = hfSelectedMembeID runat = server 值 = / > < / div > 这个我隐藏的字段,我想把我的转发器ID。 功能 clickshowtick(tckclass){ if ($(' #' + tckclass).hasClass( tick_img)) $(' #' + tckclass).removeClass( tick_img); else $(' #' + tckclass).addClass( tick_img); $( #<%= hfSelectedMembeID.ClientID%>)。val (tckclass); var str; str = $( #<%= hfSelectedMembeID.ClientID%>) .val(tckclass)+ ' ,' + tckclass} 这是我设计课程顶部的javascript代码。 这是一个我不知道的问题如何在点击时从转发器链接按钮获取id。之后如何将其放入隐藏字段中 之后我怎么能在后面的代码中获取它。 最后如何将它存储在数据库中。 请帮帮我。 thxxxxxxxxxxxxxxxxxxxx 解决方案 (' #' + tckclass).hasClass( tick_img)) (' #' + tckclass)。removeClass( tick_img); else (' #' + tckclass).addClass( tick_img) ; <div> <ul class="ul-Clinical" style="margin-removed 5px;"> <asp:Repeater ID="rptAllMembers" runat="server"> <ItemTemplate> <li class="ul_Clinical_li1" style="margin-removed 10px; margin-removed 15px; border: 1px solid #ccc; width: 100px; height: 100px;" önclick="clickshowtick('<%# Eval("TherapistStaffID") %>')"> <div id='<%# Eval("TherapistStaffID") %>' class=""> </div> <img src="../images/Avatar.png" alt="TimeSheet" style="width: 50px;" /><br /> <asp:Label ID="lblUsername" runat="server" ToolTip='<%# Eval("FirstName") + " " + Eval("LastName") %>' Text='<%# Eval("FirstName") + " " + Eval("LastName") %>'></asp:Label> </li> </ItemTemplate> </asp:Repeater> </ul> </div>This is my for repeater i am implementing the tick class on it of jquery.and getting id from my table.in eval id=''<%# Eval("TherapistStaffID") %>''<div class="DivGeneral"> <asp:Label ID="lblSearch" runat="server" Text="Search:" Width="50px"></asp:Label> <asp:TextBox ID="txtSearch" runat="server" CssClass="sf" Width="423px"> </asp:TextBox> <%--Hidden Field--%> <asp:HiddenField ID="hfSelectedMembeID" runat="server" Value="" /> </div>this my hidden field in which i want to put my repeater id.function clickshowtick(tckclass) { if ($('#' + tckclass).hasClass("tick_img")) $('#' + tckclass).removeClass("tick_img"); else $('#' + tckclass).addClass("tick_img"); $("#<%=hfSelectedMembeID.ClientID %>").val(tckclass); var str; str = $("#<%=hfSelectedMembeID.ClientID %>").val(tckclass) + ',' + tckclass }this is my javascript code at the top of my design class.here is a problem that i dont know how to get the id from repeater link button on click.and after that how to put it in hidden fieldand after that how can i get it at code behind.at last how to store it in database.please help me.thxxxxxxxxxxxxxxxxxxxx 解决方案 ('#' + tckclass).hasClass("tick_img"))('#' + tckclass).removeClass("tick_img"); else('#' + tckclass).addClass("tick_img"); 这篇关于如何使用c#和javascript从转发器获取价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-27 09:55