母版页相关问题 [英] Master page related problem

查看:65
本文介绍了母版页相关问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" 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">
    
</head>
<body>
    <form id="form1"  runat="server">
   
    <table style="width: 100%;">
        <tr>
            <td colspan="4">
                <img alt="" height="50px" src="Images/02048_thecliffs_1600x1200.jpg" 
                    width="100%" /></td>
        </tr>
        <tr>
            <td>
                <asp:LinkButton ID="LinkButton1" runat="server">Home
            </td>
            <td>
                <asp:LinkButton ID="LinkButton2" runat="server">Pets
            </td>
            <td>
                <asp:LinkButton ID="LinkButton3" runat="server">register
            </td>
            <td>
                <asp:LinkButton ID="LinkButton4" runat="server">Contact us
            </td>
        </tr>
        <tr>
            <td>
                <asp:TreeView ID="TreeView1" runat="server">
                    <nodes>
                        <asp:TreeNode Text="Home" Value="Home">
                            <asp:TreeNode Text="Pets animals" Value="Pets animals">
                                <asp:TreeNode Text="Big" Value="Big">
                                <asp:TreeNode Text="Small" Value="Small">
                            
                            <asp:TreeNode Text="Bird" Value="Bird">
                                <asp:TreeNode Text="Big" Value="Big">
                                <asp:TreeNode Text="Small" Value="Small">
                            
                        
                    </nodes>
                
            </td>
            <td colspan="3">
                <div>
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        
        
    </div></td>
        </tr>
    </table>
    </form>
    <table style="width: 100%;">
        <tr>
            <td>
                <img alt="" height="50px" src="Images/01747_inflight_1440x900.jpg" 
                    width="100%" /></td>
        </tr>
    </table>
</body>
</html>


我的浏览器未显示任何内容.这是我的浏览器错误或我的.Net框架

当我运行此代码.在我的浏览器中显示


My browser did not show anything. It is my browser error or my .Net framework

when i run this code. In my browser shows

Directory Listing -- /WebSite9/

      Saturday, July 16, 2011 01:26 AM        <dir> Images
      Saturday, July 16, 2011 01:29 AM        2,660 MasterPage.master
      Saturday, July 16, 2011 12:58 AM          290 MasterPage.master.cs
      Saturday, July 16, 2011 01:02 AM          290 web.config

Version Information: ASP.NET Development Server 10.0.0.0



我不知道为什么它显示此



I do not know why it shows this

推荐答案

似乎您尚未设置启动页面.因此,只需右键单击默认页面(您想将哪个页面显示为索引页面)并设置为默认页面即可.
It''s seems you haven''t set start-up page. So just right click on default page (which page do you want to show as index page) and set as default page.


您确定确实犯了这两个错误之一:

1-您正在尝试在浏览器中查看母版页,但该浏览器不被接受,因此请尝试查看内容页.

2-您没有设置启动页面,因此将其中一个页面设置为默认页面.

此致,
you are for sure doing one of those 2 mistakes :

1-you are trying to view the master page in the browser which is not accepted so try to view the content pages instead.

2-you did not set the startup page so set one of the pages to the default page.

Regards ,


这篇关于母版页相关问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆