locked
Error opening URLs RRS feed

  • Question

  • User2037455357 posted

    Hello there.

    I have the following Image with a URL

    but with some websites I get a webpage error screen.

    <div class="navbar-header">
          <p>
              <a href="http://rollonmonday.co.uk/">
              <img class="img-responsive pull-left" src="images/Logo_3.png" /> </a>
          </p>
      </div>
    

    does anyone have any ideas why,  I open the website in the normal fashion the site all works fine, 

    I tried Yahoo and that's work fine.

    Wednesday, May 15, 2019 6:43 PM

All replies

  • User475983607 posted

    If the images folder is at the application root then the syntax is...

    <img class="img-responsive pull-left" src="/images/Logo_3.png" /> </a>

    Otherwise the browser looks for an images folder from the current page address.

    See HTML file paths for more information.

    https://www.w3schools.com/html/html_filepaths.asp

    Wednesday, May 15, 2019 6:56 PM
  • User2037455357 posted

    Hello Mgebhard

    Thank you for your reply,

    I have just updated my code using (  src="/images/Logo_3.png"  )

    but I am still getting the webpage error, could there be anything else ?

    Wednesday, May 15, 2019 7:15 PM
  • User475983607 posted

    What is the error?  Are you getting an error when clicking the link?  What is the URL in the address bar when you get this error?

    Wednesday, May 15, 2019 7:20 PM
  • User2037455357 posted

    the website opens, then the Webpage error pops up with

    Line 1

    Error: Object Expected

    url is http://rollonmonday.co.uk

    that's it

    Wednesday, May 15, 2019 7:29 PM
  • User475983607 posted

    the website opens, then the Webpage error pops up with

    Line 1

    Error: Object Expected

    url is http://rollonmonday.co.uk

    that's it

    JavaScript errors.  You are referencing JS libraries that require jQuery before jQuery is referenced.  The jQuery reference must come before the dependent libraries.

    Wednesday, May 15, 2019 7:35 PM
  • User2037455357 posted

    This is the full Master script Im using,

    I thought I am using the right JS reference,

    I have the latest bootstrap installed!

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Master.master.cs" Inherits="TestDropdowns.Master" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
    
    
    
             <meta charset="UTF-8">
    <title>Master</title>
    
      <script src="scripts/jQuery-3.4.1.min.js"></script>   
        <link href="Content/bootstrap.min.css" rel="stylesheet" /> 
    
    
    <script type="text/javascript">
        $(document).ready(function () {
            $(".dropdown, .btn-group").hover(function () {
                var dropdownMenu = $(this).children(".dropdown-menu");
                if (dropdownMenu.is(":visible")) {
                    dropdownMenu.parent().toggleClass("open");
                }
            });
        });                       
    </script>
    
    
    <style type="text/css">
    
    @media screen and (min-width: 768px) {
      .dropdown:hover .dropdown-menu, .btn-group:hover .dropdown-menu{
                                    display: block;
                    }
    
      .bs-example{
                    align-items:center;
    }
    
                    .dropdown-menu{
                                    margin-top: 0;
                    }
                    .dropdown-toggle{
                                    margin-bottom: 2px;
                    }
                    .navbar .dropdown-toggle, .nav-tabs .dropdown-toggle{
                                    margin-bottom: 0;
            text-align: left;
            margin: 0 auto;
    
            
                    }
    
    
        /*ALL OTHER STYLES HERE*/
    
       .logo {
           
       }
    
    
    
        }
    
        
    </style>
       
    </head>
    <body>
       
    
        <br />
    
        <%-- START NAVIGATION---------------------------- --%>
    
    
         <%-- LOGO WITHIN NAVIGATION USING LEFT ALIGNMENT-------------------------------------%>
    
                
       <nav class="navbar navbar-default" role="navigation">
    
           <%-- Toggle button for tablets and phones --%>
    
      <div>
          <p>
              <a href="http://rollonmonday.co.uk/">
              <img class="img-responsive pull-left" src="/Images/Logo_3.png" /> </a>
          </p>
      </div>
    
    
    
    <%--END OF LOGO----------------------------------%>
    
    
    <%-- END -------------------------------------------------------%>
    
    
    
    <%-- DROP DOWN MENUS USING LEFT ALIGNMENT --%>
    
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav navbar-left">
                       <%-- <li><a href="#">Home</a></li>
                        <li><a href="#">Profile</a></li>--%>
                        <li class="dropdown">
                            <a href="#" data-toggle="dropdown" class="dropdown-toggle">Menu to Configure <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="#">Inbox</a></li>
                                <li><a href="#">Drafts</a></li>
                                <li><a href="#">Sent Items</a></li>
                                <li class="divider"></li>
                                <li><a href="#">Trash</a></li>
                            </ul>
                        </li>
                    </ul>
    
    
                    <ul class="nav navbar-nav navbar-left">
                       <%-- <li><a href="#">Home</a></li>
                        <li><a href="#">Profile</a></li>--%>
                        <li class="dropdown">
                            <a href="#" data-toggle="dropdown" class="dropdown-toggle">Menu to Configure <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="#">Inbox</a></li>
                                <li><a href="#">Drafts</a></li>
                                <li><a href="#">Sent Items</a></li>
                                <li class="divider"></li>
                                <li><a href="#">Trash</a></li>
                            </ul>
                        </li>
                    </ul>
    
    <%-- END --DROPDOWN MENUS-----------------------------------------------------%>
    
        <%-- LABEL LOGIN WITH RIGHT ALIGNMENT-----------------------------------------------------%>
    
    
                    <div class="nav navbar-nav navbar-right">
                       
                        <asp:Label ID="Label5" runat="server" Text="Username" Width="70px"></asp:Label>
                       
                    </div>
    
    
        </div>
                
    
    
    
    </nav>
    
    <%-- END navigation -------------------------------------------------------%>
    
           
    
        <form id="form1" runat="server">
    
              <div>
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                </asp:ContentPlaceHolder>
            </div>
    
        </form>
       
    
        <script src="Scripts/jquery-3.1.1.js"></script>
        <script src="Scripts/bootstrap.js"></script>
    </body>
    </html>
    
    

    Wednesday, May 15, 2019 8:24 PM
  • User475983607 posted

    The master page shows jQuery and Bootstrap referenced twice.  Also this master page markup looks different than the markup found in; http://rollonmonday.co.uk/.   You have references to jQuery 3.4.1 and the link is referencing jQuery 1.11.0.  At this point, I don't think you are showing us the correct code.  Either way both applications have issues that need to be fixed.

    Wednesday, May 15, 2019 8:34 PM
  • User2037455357 posted

    Hi there

    I have made some changes to my code and now my navBars are not showing.

    I have played around with the script declarations at the top, so im not sure if they are in the right order or what,

    Please forgive me I only started using bootstrap last week so im still learning LOL.

    see full master code below.

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Master.master.cs" Inherits="TestDropdowns.Master" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
    
    
    
             <meta charset="UTF-8">
    <title>Master</title>
    
    
    
    
     
    
     <link href="Content/bootstrap.min.css" rel="stylesheet" /> 
    
         <script src="Scripts/jquery-3.4.1.js"></script>
    
         <script src="Scripts/bootstrap.min.js"></script>
    
        <script src="scripts/jQuery-3.4.1.min.js"></script>   
       
        <script src="Scripts/bootstrap.js"></script>
    
    
    
    <script type="text/javascript">
        $(document).ready(function () {
            $(".dropdown, .btn-group").hover(function () {
                var dropdownMenu = $(this).children(".dropdown-menu");
                if (dropdownMenu.is(":visible")) {
                    dropdownMenu.parent().toggleClass("open");
                }
            });
        });		
    </script>
    
    
    <style type="text/css">
    
    @media screen and (min-width: 768px) {
      .dropdown:hover .dropdown-menu, .btn-group:hover .dropdown-menu{
    		display: block;
    	}
    
      .bs-example{
    	align-items:center;
    }
    
    	.dropdown-menu{
    		margin-top: 0;
    	}
    	.dropdown-toggle{
    		margin-bottom: 2px;
    	}
    	.navbar .dropdown-toggle, .nav-tabs .dropdown-toggle{
    		margin-bottom: 0;
            text-align: left;
            margin: 0 auto;
    
            
    	}
    
    
        /*ALL OTHER STYLES HERE*/
    
       .logo {
           
       }
    
    
    
        }
    
        
    </style>
       
    </head>
    <body>
       
    
        <br />
    
        <%-- START NAVIGATION---------------------------- --%>
    
                
       <nav class="navbar navbar-default" role="navigation">
    
           <%-- Toggle button for tablets and phones --%>
    
      
    
    
    <%-- END -------------------------------------------------------%>
    
    
    
    <%-- DROP DOWN MENUS USING LEFT ALIGNMENT --%>
    
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav navbar-left">
                       <%-- <li><a href="#">Home</a></li>
                        <li><a href="#">Profile</a></li>--%>
                        <li class="dropdown">
                            <a href="#" data-toggle="dropdown" class="dropdown-toggle">Menu to Configure <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="#">Inbox</a></li>
                                <li><a href="#">Drafts</a></li>
                                <li><a href="#">Sent Items</a></li>
                                <li class="divider"></li>
                                <li><a href="#">Trash</a></li>
                            </ul>
                        </li>
                    </ul>
    
    
                    <ul class="nav navbar-nav navbar-left">
                       <%-- <li><a href="#">Home</a></li>
                        <li><a href="#">Profile</a></li>--%>
                        <li class="dropdown">
                            <a href="#" data-toggle="dropdown" class="dropdown-toggle">Menu to Configure <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="#">Inbox</a></li>
                                <li><a href="#">Drafts</a></li>
                                <li><a href="#">Sent Items</a></li>
                                <li class="divider"></li>
                                <li><a href="#">Trash</a></li>
                            </ul>
                        </li>
                    </ul>
    
    <%-- END --DROPDOWN MENUS-----------------------------------------------------%>
    
        <%-- LABEL LOGIN WITH RIGHT ALIGNMENT-----------------------------------------------------%>
    
        <%--<asp:Label ID="Label5" runat="server" Text="Username" Width="70px"></asp:Label>--%>
    
         <%--<asp:Label--%>
                    <div class="nav navbar-nav navbar-right">
                       
                        <asp:Label ID="Label5" runat="server" Text="Username" Width="70px"></asp:Label>
                       
                    </div>
    
    
        </div>
                
    
    
    
    </nav>
    
    <%-- END navigation -------------------------------------------------------%>
    
           
    
        <form id="form1" runat="server">
    
              <div>
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                </asp:ContentPlaceHolder>
            </div>
    
        </form>
       
         <script src="Scripts/jquery-3.4.1.js"></script>
    
         <script src="Scripts/bootstrap.min.js"></script>
    
        <script src="scripts/jQuery-3.4.1.min.js"></script>   
       
        <script src="Scripts/bootstrap.js"></script>
    
        
    
    </body>
    </html>

    Many thanks

    Thursday, May 16, 2019 6:19 AM
  • User2037455357 posted

    just to make sure I have reused the original code in this post to see if the Nav bar comes back and still not working.

    SO something strange has happened.

    Thursday, May 16, 2019 6:37 AM
  • User-1174608757 posted

    Hi masterdineen,

    According to your codes , in fact you don't need to add javascript reference in your sub page if you have added it in Master page,In fact ,subpage will finally show with master page .So you only need add js on master page.

    Then you don't need to add both jquery.js and jquery.min.js  which is same as bootstrap.js and bootstrap.mini.js  ,they are the same js file,min.js is just compressed type.

    Else, I suggest that you could use Chrome browser and F12 then you could see  if there exists any error and you could use the tool like mouse symbol on the left to catch the attribute in your page .You could see as below:

    Best Regards

    Wei

    Thursday, May 16, 2019 9:13 AM