2015-10-19 25 views
0

我有一個菜單類,其中包含項目中的所有類,當我點擊鏈接到其他類時,我在Opera瀏覽器中得到錯誤。 「 」此網頁不可用從菜單連接不工作

Opera對本地主機的連接嘗試被拒絕,網站可能關閉,或者您的網絡可能配置不正確。 我找不到代碼中的問題。 非常感謝你!

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Data; 
using MySql.Data.MySqlClient; 

namespace WebApplication1 
{ 
    public partial class meni : System.Web.UI.Page 
    { 
     protected void Page_Load(object sender, EventArgs e) 
     { 

     } 


    } 
} 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="meni.aspx.cs" Inherits="WebApplication1.meni" %> 

<!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> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 

    </div> 
    <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" BackColor="#B5C7DE" 
     DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="Larger" 
     ForeColor="#284E98" StaticSubMenuIndent="12px"> 
     <DynamicHoverStyle BackColor="#284E98" ForeColor="White" /> 
     <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" /> 
     <DynamicMenuStyle BackColor="#B5C7DE" /> 
     <DynamicSelectedStyle BackColor="#507CD1" /> 
     <Items> 
      <asp:MenuItem NavigateUrl="http://localhost:56717/Customer.aspx" 
       Text="costumers" Value="costumers"></asp:MenuItem> 
      <asp:MenuItem NavigateUrl="http://localhost:56717/Vendor.aspx" Text="Vendors" 
       Value="Vendors"></asp:MenuItem> 
      <asp:MenuItem NavigateUrl="http://localhost:56717/region.aspx" Text="Regions" 
       Value="Regions"></asp:MenuItem> 
      <asp:MenuItem NavigateUrl="http://localhost:56717/Service.aspx" Text="Service" 
       Value="Service"></asp:MenuItem> 
      <asp:MenuItem NavigateUrl="http://localhost:56717/usage.aspx" Text="Usages" 
       Value="Usages"></asp:MenuItem> 
      <asp:MenuItem NavigateUrl="http://localhost:56717/comDisp.aspx" 
       Text="Commitments" Value="Commitments"></asp:MenuItem> 
     </Items> 
     <StaticHoverStyle BackColor="#284E98" ForeColor="White" /> 
     <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" /> 
     <StaticSelectedStyle BackColor="#507CD1" /> 

    </asp:Menu> 
    </form> 
</body> 
</html> 

回答

0

看起來像你的HREF中的菜單項的問題 - 而不是NavigateURL = 「HTTP://本地主機:56717/Vendor.aspx」 嘗試使用相對URL,例如:

NavigateURL="~/Vendor.aspx"