I have a gridview that contains a link button. Using jQuery and CSS, I've set up a lightbox for the link button.
Here's the source code for the link button:
<asp:TemplateField HeaderText="Course" ItemStyle-CssClass="course" HeaderStyle-CssClass="course">
<ItemTemplate>
<asp:LinkButton ID="Course_Name" runat="server" Text='<%# Eval("Course_Name__c") %>' ForeColor="#666699" CommandName="course" CommandArgument='<%# ((GridViewRow) Container).RowIndex %>' ></asp:LinkButton>
</ItemTemplate>
<HeaderStyle Font-Bold="True" />
<HeaderStyle HorizontalAlign="Center"/>
<ItemStyle CssClass="course"></ItemStyle>
</asp:TemplateField>
In order to populate the content of the lightbox in the rowcommand event, I'm using the following code in rowdatabound:
cname.CssClass = "popup-with-zoom-anim";
cname.Attributes.Add("href", "#smalldialog");
The script used for this purpose is as follows:
<script type="text/javascript">
$(document).ready(function () {
$('.popup-with-zoom-anim').magnificPopup({
type: 'inline',
fixedContentPos: false,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in'
});
$('.popup-with-move-anim').magnificPopup({
type: 'inline',
fixedContentPos: false,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-slide-bottom'
});
});
</script>
However, the rowcommand is not firing, causing the lightbox to display no data. Any help on resolving this issue would be greatly appreciated.