Link to home
Start Free TrialLog in
Avatar of doramail05
doramail05Flag for Malaysia

asked on

fancybox object required error

while requesting to use popup by assigning to ahref id="inline" . having object require error pointing to line below :


<script>

        $("a#inline").fancybox({
            'hideOnContentClick': true
        });

    </script>
aspx
----
 <script type="text/javascript" src="Images/Script/jquery-1.4.3.min.js"></script>
<script>

        $("a#inline").fancybox({
            'hideOnContentClick': true
        });

    </script>

code-behind
-----------
litMedia.Text = "<li><a id='inline' href=""popup.aspx?strapp=" & NewDS1.Tables(0).Rows(i)("ID") & """>" & NewDS1.Tables(0).Rows(i)("Subject").ToString() & "</a></li>"

popup
-----
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table>
        <tr>
            <td><asp:Label id="lbl01" runat="server" /></td>
        </tr>
    </table>
    </div>
    </form>
</body>
</html>

popup.aspx.cs
-------------
Partial Public Class popup
    Inherits System.Web.UI.Page

    Dim objBOMedia As New BOMedia

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim strID As String = DirectCast(Request.QueryString("strapp"), String)

        Dim NewDS1 As New DataSet

        NewDS1 = objBOMedia.getMediaByID(strID)

        If NewDS1.Tables(0).Rows.Count > 0 Then

            lbl01.Text = NewDS1.Tables(0).Rows(0)("MediaContent").ToString()

        End If

    End Sub

End Class

Open in new window

jquery-1.4.3.min.js
style.css
fancy-close.png
Avatar of R-Byter
R-Byter
Flag of Serbia image

Do you have jquery.fancybox-1.3.4.pack.js referenced?
You also need to enclose fancybox code for a#inline in document.ready:

<script>
$(document).ready(function() {
        $("a#inline").fancybox({
            'hideOnContentClick': true
        });
});
</script>

Open in new window


Regards
ASKER CERTIFIED SOLUTION
Avatar of doramail05
doramail05
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of doramail05

ASKER

found solutions