0

I have a formview attached to a gridview so that when I click select on a record on my gridview, the record populates in the gridview. Now I want to open the formview in a lightbox, but I am running into trouble.

here is my javascript class:

    $('.lightbox').click(function () {
            $('.backdrop, .box').animate({ 'opacity': '.50' }, 300, 'linear');
            $('.box').animate({ 'opacity': '1.00' }, 300, 'linear');
            $('.backdrop, .box').css('display', 'block');
        });

here is my HTML:

    <asp:TemplateField HeaderText="Select">
    <ItemTemplate>
    <asp:LinkButton ID="LinkButton3" CommandArgument='<%# Eval("num") %>' CommandName="Select" runat="server" Text="Select" /> 
    </ItemTemplate>
    </asp:TemplateField>

How to add the javascript class "lightbox" to the linkbutton?

4

1 回答 1

1

ASP.NET controls have a CssClass property you can write to, which translates into a class HTML attribute.

<asp:LinkButton ID="LinkButton3" ... CssClass="lightbox" />
于 2013-03-31T03:29:53.313 回答