I want to thank lincolnk for his answer. I'm currently helping to build a new social network for googam.com. I have been searching for a few days for a solution to view a user's profile, in a datalist, in a jquery modal dialog popup. Setting the linkbutton OnClientClick in the ItemDataBound event solved the problem of passing the user id to the JQuery function to open a acsx user control in the popup window.
jQuery(document).ready(function () {
var mydiv = jQuery("#mydialog").dialog({
autoOpen: false,
resizable: false,
modal: true,
width: '500',
height: '400'
}).css("font-size", "0.8em");
});
function ShowPopup(uid) {
var mydiv = jQuery("#mydialog")
//alert(uid)
// Load the content using AJAX
mydiv.load('Profile.aspx?id=' + uid);
// Open the dialog
mydiv.dialog('open');
}
//////////////
Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As DataListItemEventArgs)
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
Dim imageControl = TryCast(e.Item.FindControl("Image1"), Image)
Dim Uid As String = imageControl.ImageUrl
Dim ProfileBtn As LinkButton = TryCast(e.Item.FindControl("ProfileButton"), LinkButton)
ProfileBtn.OnClientClick = String.Format("ShowPopup('{0}');return false;", Uid)
End If
End Sub