Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 Sub

this 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?
Posted
Comments
Tushar sangani 10-Dec-14 0:13am    
use Timer Click Control With Update Panel

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900