本文介绍了如何使用ajax / asp.net / vb / jquery / boostrap / modal更新html表的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我在使用html表中的动态按钮更新值时遇到问题而没有刷新使用ASP / VB.NET这里是我的表: < table data-toggle =tableid =subjectTabledata-show-toggle =truedata-show-columns =truedata-search =truedata-select-item-name =toolbar1data -pagination =truedata-sort-name =namedata-sort-order =desc> < thead> < tr class =info> < th data-sortable =true>学生ID< / th> < th data-sortable =true >学生编号< / th> < th data-sortable =true>姓氏< / th> < th data-sortable = true>名字< / th> < th data-sortable =true>中间名< / th> < th data-sortable =true>课程< / th> < th data-sortable =true>电子邮件< / th> < th data-sortable =true>移动< / th> < th data-sortable =true>电话< / th> < th data-sortable =true>地址< / th> < th data-sortable =true>出生日期< / th> < th>< i class =glyphicon glyphicon-pencil>< />< / th> < / tr> < / thead> < asp:Repeater ID =Repeater1runat =server> < ItemTemplate> < tr> < td><%#Eval(studentID)%>< / td> < td><%#Eval(studentNumber)%> ; < / td> < td><%#Eval(studentLastname)%> < / td> < td><%#Eval(studentFirstname)%> < / td> < td><%#Eval(studentMiddlename)%> < / td> < td><%#Eval(courseID)%> < / td> < td><%#Eval(studentEmail)%> < / td> < td><%#Eval(studentMobile)%> < / td> < td><%#Eval(studentPhone)%> < / td> < td><%#Eval(studentAddress)%> < / td> < td><%#Eval(studentBirthday)%> < / td> < td> < asp:UpdatePanel ID =UpdatePanel1runat =server> < ContentTemplate> < asp:Button ID =buttonrunat =serverText =ButtonOnClick =handleEditClickOnClientClick =dynamicClick(); CommandArgument ='<%#Eval(studentID)%>'CommandName =edit/> < / ContentTemplate> < / asp:UpdatePanel> < / td> < / tr> < / ItemTemplate> < / asp:Repeater> < / table> dynamicClick();显示模态弹出式引导程序.. 函数dynamicClick() { $('#editModal')。modal('show') } onClickHandler处理为更新查询目的传递studentID值。 受保护的Sub OnClickHandler(ByVal发送者为As对象,ByVal e As EventArgs) Dim lnk As Button = CType(发送者,按钮) 选择案例lnk.CommandName 案例编辑 lnk.CommandArgument = Val(lnk.CommandArgument) getID(lnk.CommandArgument) 结束选择 结束子 这个onclickhandler仅在我删除updatepanel时才有效..但是如果我删除了updatepanel页面刷新并且模态将无法工作..任何想法? I'm having problems with updating a value using a dynamic button in my html table without refreshing using ASP/VB.NET here's my table: <table data-toggle="table" id="subjectTable" data-show-toggle="true" data-show-columns="true" data-search="true" data-select-item-name="toolbar1" data-pagination="true" data-sort-name="name" data-sort-order="desc"> <thead> <tr class="info"> <th data-sortable="true">Student ID</th> <th data-sortable="true">Student Number</th> <th data-sortable="true">Last Name</th> <th data-sortable="true">First Name</th> <th data-sortable="true">Middle Name</th> <th data-sortable="true">Course</th> <th data-sortable="true">Email</th> <th data-sortable="true">Mobile</th> <th data-sortable="true">Phone</th> <th data-sortable="true">Address</th> <th data-sortable="true">Birth Date</th> <th><i class="glyphicon glyphicon-pencil"></></th> </tr> </thead> <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <tr> <td><%#Eval("studentID")%></td> <td><%#Eval("studentNumber")%> </td> <td><%#Eval("studentLastname")%> </td> <td><%#Eval("studentFirstname")%> </td> <td><%#Eval("studentMiddlename")%> </td> <td><%#Eval("courseID")%> </td> <td><%#Eval("studentEmail")%> </td> <td><%#Eval("studentMobile")%> </td> <td><%#Eval("studentPhone")%> </td> <td><%#Eval("studentAddress")%> </td> <td><%#Eval("studentBirthday")%> </td> <td> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Button ID="button" runat="server" Text="Button" OnClick="handleEditClick" OnClientClick="dynamicClick();" CommandArgument='<%#Eval("studentID")%>' CommandName="edit" /> </ContentTemplate> </asp:UpdatePanel> </td> </tr> </ItemTemplate> </asp:Repeater> </table>dynamicClick(); shows the modal popup bootstrap.. function dynamicClick() { $('#editModal').modal('show') }onClickHandler handles the passing of studentID values for update Query purpose. Protected Sub OnClickHandler(ByVal sender As Object, ByVal e As EventArgs) Dim lnk As Button = CType(sender, Button) Select Case lnk.CommandName Case "edit" lnk.CommandArgument = Val(lnk.CommandArgument) getID(lnk.CommandArgument) End Select End Subthis onclickhandler only works when I remove the updatepanel.. but if i remove the updatepanel the page refreshes and the modal will not work.. any ideas?解决方案 ('#editModal')。modal('show') } onClickHandler处理为更新查询目的传递studentID值。 Protected Sub OnClickHandler(ByVal sender As Object,ByVal e As EventArgs) Dim lnk As Button = CType(sender,Button) Select Case lnk.CommandName 案例编辑 lnk.CommandArgument = Val(lnk.CommandArgument) getID(lnk.CommandArgument) 结束选择 结束子 这个onclickhandler仅在删除updatepanel时有效..但如果我删除updatepanel页面刷新并且莫代尔将无法运作..任何想法?('#editModal').modal('show') }onClickHandler handles the passing of studentID values for update Query purpose. Protected Sub OnClickHandler(ByVal sender As Object, ByVal e As EventArgs) Dim lnk As Button = CType(sender, Button) Select Case lnk.CommandName Case "edit" lnk.CommandArgument = Val(lnk.CommandArgument) getID(lnk.CommandArgument) End Select End Subthis onclickhandler only works when I remove the updatepanel.. but if i remove the updatepanel the page refreshes and the modal will not work.. any ideas? 这篇关于如何使用ajax / asp.net / vb / jquery / boostrap / modal更新html表的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-29 12:10