Hi, this is regarding code publshed on ASP Snippets called 'Load on demand data in GridView on scroll using ASP.Net and jQuery AJAX' by Mudassar Khan. https://www.aspsnippets.com/Articles/Load-on-demand-data-in-GridView-on-scroll-using-ASPNet-and-jQuery-AJAX.aspx
After messaging Mudassar last year I made slight changes to the original code as posted, which ended up being able to click on a link on the gridview which opened a popup page displaying data. The alterations are below. My question is, is it possible to run code behind (VB in my case) from the link rather than opening a new page. The purpose of this would be to open an Ajax modalpopup after the panel is populated with data.
alteration to the ASPX page is :-
$(row).find('.lnkEntry').attr('href', "JavaScript: createWindow('SettingsNew.aspx')")
$(row).find('.lnkEntry').html(customer.find("Ein").text());
$("[id$=gvCustomers]").append(row);
<script type = "text/javascript">
function createWindow(url) {
var newWindow = window.open(url, "newWindow", "toolbar=yes,scrollbars=yes,width=650,height=500");
}
</script>
alteration to the Code Behind page is :-
Protected Sub gvCustomers_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim drv As DataRowView = DirectCast(e.Row.DataItem, DataRowView)
Dim mylink As New HtmlAnchor()
mylink.Attributes("class") = "lnkEntry"
Dim strid As String = e.Row.Cells(0).Text
mylink.HRef = String.Format("JavaScript: createWindow('SettingsNew.aspx?id=" & strid & "')")
mylink.InnerText = e.Row.Cells(0).Text
e.Row.Cells(0).CssClass = ""
e.Row.Cells(0).Controls.Add(mylink)
End If
End Sub
What I'm hoping to fireup is :-
Private Sub ShowModalPopupExtender(byval sData as string)
' Fill panel with data from database or datatable
mp1.Show() 'then display ModalPopupExtender
End Sub
many thanks for your time
Mick