Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4007260
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:36:42+00:00 2026-05-20T08:36:42+00:00

I am using a Masterpage for my upload_photo.aspx which displays the file upload page

  • 0

I am using a Masterpage for my upload_photo.aspx which displays the file upload page using colorBox. However, ever since i added (code below) in the Masterpage colorBox doesn’t display:

<script type="text/javascript">
            $(function () {
                $("#txtAutoCompleteSearch").AutoComplete("search.aspx?searchword=");
            });

            function clear_textbox() {
                if (document.aspnetForm.searchField.value == " Enter Your Search Here ")
                    document.aspnetForm.searchField.value = "";
            };

        </script>

Below is the mastpage code:

<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
   <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    <link href="Css/menu_style.css" rel="stylesheet" type="text/css" />
     <link href="styles/css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">        google.load('jquery', '1.3.2');</script>
    <script src="styles/js/jquery.autocomplete.js" type="text/javascript"></script>
    <script src="styles/js/jquery.dimensions.js" type="text/javascript"></script>
    <script src="styles/js/jquery.highlight-3.yui.js" type="text/javascript"></script>


    <script type="text/javascript">
        $(function () {
            $("#txtAutoCompleteSearch").AutoComplete("search.aspx?searchword=");
        });

        function clear_textbox() {
            if (document.aspnetForm.searchField.value == " Enter Your Search Here ")
                document.aspnetForm.searchField.value = "";
        };

    </script>

</head>
<body>
    <form id="masterPageForm" runat="server">

    <div id="pagewidth">
        <div id="Header">
            <asp:Label ID="userName" runat="server" Text="" style=" color: Maroon; font-size: large; z-index: 103; left: 805px; position: absolute; top: 132px"></asp:Label>
             <asp:LoginStatus ID="LoginStatus1" runat="server" ForeColor="White" 
                LogoutPageUrl="~/Default.aspx" LogoutText="Logout" CssClass="logOut" 
                BackColor="#454545" Font-Bold="True" Font-Names="Arial Black" 
                Font-Size="Small" />

            <%--<asp:Image ID="logoHeader" runat="server" CssClass="rounded-corners" ImageUrl="~/img/logo.png"/>--%>
            <asp:HyperLink ID="hlLogo" runat="server" ImageUrl="~/img/logo.png" NavigateUrl="~/home.aspx"></asp:HyperLink>

            <%--style="width: 1000px; height: 120px; margin-top: 10px;" />--%>
            <div style="top: 61px; left: 476px; position: absolute; height: 37px; width: 526px; font-size: medium; font-style: italic; color: #CCFF99; font-weight: bolder; z-index: 103;">
                <input id="txtAutoCompleteSearch" name="searchField" class="tb11" type="text" onfocus="clear_textbox()" value=" Enter Your Search Here "/> 
            <asp:ContentPlaceHolder id="Heading" runat="server">

            </asp:ContentPlaceHolder>

            </div>

        <div class="background">
   <asp:menu id="NavigationMenu" CssClass="NavigationMenu"  
        staticdisplaylevels="2" DynamicHorizontalOffset="1"
        staticsubmenuindent="1px" MaximumDynamicDisplayLevels="4"
        orientation="Horizontal"   
        DynamicPopOutImageUrl="~/img/right-arrow.gif" 
        StaticPopOutImageUrl="~/img/drop-arrow.gif"
        datasourceid="MenuSource"    
        runat="server" Height="30px">

        <staticmenuitemstyle ItemSpacing="10" CssClass="staticMenuItemStyle"/>
        <statichoverstyle CssClass="staticHoverStyle" />
        <StaticSelectedStyle CssClass="staticMenuItemSelectedStyle"/> 
        <DynamicMenuItemStyle CssClass="dynamicMenuItemStyle" />      
        <dynamichoverstyle CssClass="menuItemMouseOver" />
        <DynamicMenuStyle CssClass="menuItem" />
        <DynamicSelectedStyle CssClass="menuItemSelected" />

        <DataBindings>        
             <asp:MenuItemBinding DataMember="siteMapNode" 
                NavigateUrlField="url" TextField="title"  
                    ToolTipField="description" />
        </DataBindings>

      </asp:menu>
    </div>

    <asp:TreeView ID="NavigationTreeView" runat="server" Visible="false" DataSourceID="MenuSource" />

<div id="e">
        <asp:SiteMapPath ID="SiteMapPath1" runat="server" 
                RenderCurrentNodeAsLink="true" 
                CssClass="currentNodeStyle"
            PathSeparator=" >> " Visible="False">
            <PathSeparatorStyle ForeColor="#5D7B9D" CssClass="currentNodeStyle" />
            <CurrentNodeStyle ForeColor="#333333" CssClass="currentNodeStyle" />
            <NodeStyle ForeColor="#7C6F57"  CssClass="currentNodeStyle"  />
            <RootNodeStyle  ForeColor="#5D7B9D" CssClass="currentNodeStyle"  />
    </asp:SiteMapPath> 
</div>    

    <asp:Panel ID="AccessKeyPanel" runat="server">
    </asp:Panel>
       <asp:SiteMapDataSource id="MenuSource" runat="server" StartFromCurrentNode="false" ShowStartingNode="true" />

       <div id="tabDiv">
             <asp:ContentPlaceHolder id="mainBody" runat="server">

             </asp:ContentPlaceHolder>   
        </div>

        <div id="footer">
            &copy; Copyright Family Photo Online System</div>
    </div>
    </div>
    </form>

<script type="text/javascript">

    function navigateTo(url) {
        window.location = url;
    }

</script>

</body>
</html>

Below is the upload_photo.aspx code for the javascript:

<script src="alerts/impromptu/jquery.js" type="text/javascript"></script>
    <script src="alerts/impromptu/jquery-impromptu.2.6.min.js" type="text/javascript"></script>
    <link href="alerts/impromptu/impromptu.css" rel="stylesheet" type="text/css" />

<link href="colorBox/colorbox.css" rel="stylesheet" type="text/css" />
    <script src="colorBox/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="colorBox/jquery.colorbox.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //Examples of how to assign the ColorBox event to elements
            $("a[rel='example1']").colorbox();
            $("a[rel='example2']").colorbox({ transition: "fade" });
            $("a[rel='example3']").colorbox({ transition: "none", width: "75%", height: "75%" });
            $("a[rel='example4']").colorbox({ slideshow: true });
            $(".example5").colorbox();
            $(".example6").colorbox({ iframe: true, innerWidth: 425, innerHeight: 344 });
            $(".example7").colorbox({ width: "47%", height: "100%", iframe: true });
            $(".example8").colorbox({ width: "50%", inline: true, href: "#inline_example1" });
            $(".example9").colorbox({
                onOpen: function () { alert('onOpen: colorbox is about to open'); },
                onLoad: function () { alert('onLoad: colorbox has started to load the targeted content'); },
                onComplete: function () { alert('onComplete: colorbox has displayed the loaded content'); },
                onCleanup: function () { alert('onCleanup: colorbox has begun the close process'); },
                onClosed: function () { alert('onClosed: colorbox has completely closed'); }
            });

            //Example of preserving a JavaScript event for inline calls.
            $("#click").click(function () {
                $('#click').css({ "background-color": "#f00", "color": "#fff", "cursor": "inherit" }).text("Open this window again and this message will still be here.");
                return false;
            });
        });
</script>

Firebug throws the following error:

$(“a[rel=’example1′]”).colorbox is not a function
http://localhost:3478/upload_photo.aspx
Line 19

If I remove the Javascript function from the Masterpage the colorBox jQuery works fine.

Can anyone advice me where I am going wrong and how i can correct it? Any help would be appreciated.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:36:42+00:00Added an answer on May 20, 2026 at 8:36 am

    It might be because you’re including jquery both in the master page and in the photo page. This will cause jQuery to load, initialize, run the script in your master page, then throw it all out and reload, reinitialize everything when it hits the script tag for jQuery in the upload_photo.aspx. You only want each javascript library to load once, otherwise all sorts of confusion sets in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On one site, I'm only using a single level Masterpage and in a page
We are using Sharepoint 2007 In which on master page we have Asp Image
I am using a masterpage. On a accounts page I have a Usercontrol on
TGIF, I have a website I'm developing which is using ASP.NET masterpage/sitemap/content pages setup.
<%@ Page Language=C# AutoEventWireup=true MasterPageFile=~/MasterPage.Master CodeBehind=Mortgageclient.aspx.cs Inherits=MortgageSaver._Default %> protected void btnfupload_Click(object sender, EventArgs e)
I am using MasterPage and using using a CSS in master page. My problem
I am using a MasterPage with a dynamic menu bar across the page. If
I have masterpage and i am using update panels for all my partial page
I have a textbox onin a masterpage which I'm using as a search box.
I am using asp.NET with masterpages and usercontrols. In MasterPage: Doing <link href='<%=ResolveUrl(~/path/file.css)%>' rel=stylesheet

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.