I'm wondering if it there is a solution to have a asp:Button
with CommandName
inside a ListView
and make it run and execute the CommandName
, but without refreshing the page (submit). I have a modal, so I don't like the page refreshing and then showing the modal.
<asp:Button runat="server" CommandName="Details" Text="Details" />
I've already tried UseSubmitBehaviour set to false without success.
EDIT:
Protected Sub lstvLadder_ItemCommand(sender As Object, e As ListViewCommandEventArgs)
If e.CommandName = "Details" Then
Dim lblRank As Label = TryCast(e.Item.FindControl("lblRank"), Label)
Dim lblPoints As Label = TryCast(e.Item.FindControl("lblPoints"), Label)
Dim lblTeam As Label = TryCast(e.Item.FindControl("lblTeam"), Label)
Dim lblTeamLeader As Label = TryCast(e.Item.FindControl("lblTeamLeader"), Label)
MUCH CODE HERE
End If
End Sub
I want it to not refresh the page when button clicked, but I want it to run this function, commandname
If you want to see for yourself: here If you press the Details button on the right side, it refreshes the page then loads the modal instead of just loading the modal. The button I'm using to call it is the asp:Button
above, and the ItemCommand
block.