Question

I have a page called test.aspx and in that page, I have the following link:

<a href="../help/default.aspx?height=100&width=500" 
   class="thickbox">
<asp:ImageButton ID="ibtnHelp" 
                 runat="server" 
                 ImageUrl="~/images/needhelp.jpg" /></a>

When I click on the link, it opens up the default.aspx page under help in a new window instead of the thickbox.

In my masterpage, I have the following in the head for the thickbox:

    <head runat="server">

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"  
            type="text/javascript"></script>

    <script src="../js/thickbox.js" type="text/javascript"></script>

    <title>Details</title>

    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>

    <link href="styles/style.css" rel="stylesheet" type="text/css" />
    <link href="styles/RoundDiv.css" rel="stylesheet" type="text/css" />
    <link href="styles/thickbox.css" rel="stylesheet" type="text/css" />
</head>

If I put it the script directly on the test.aspx, it works fine, but not when I have it in the masterpage.

Was it helpful?

Solution

First thing to do is ensure the thickbox.js file is being served correctly when linked from the masterpage. Either use firebug or fiddler2 to establish if the file is requested and the response is a 200.

I suspect you need the following to reference thickbox...but its been ages since I had to hack around with aspx..

<script type="text/javascript" src="<%=ResolveUrl("~/js/thickbox.js") %>"></script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top