简体   繁体   English

asp.net c#使用母版页时每个Webform的标题不同

[英]asp.net c# Different title for each Webform while using Masterpage

i just uploaded my site and everything works great, however. 我刚刚上传了我的网站,但是一切正常。 i just realised that no matter where i am on my website, it allways display the same title ("thiswebsite.com" etc, if i didnt enter any title on the master page) and if i DO enter a title on the master page then, of course. 我只是意识到,无论我在网站上的哪个位置,如果我没有在母版页上输入任何标题,它总是显示相同的标题(“ thiswebsite.com”等),并且如果我确实在母版页上输入标题,那么, 当然。 It only show's said title. 它只显示标题。 no matter which page im on. 无论我在哪个页面上 So, how do i for each webform, have a different title for said page? 那么,我该如何为每个Web表单的页面指定不同的标题? i have never actually done this before. 我以前从未真正做到过。

This is my current masterpage "head" 这是我当前的主页“头”

<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
    <meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"/>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'/>
    <link href="StyleSheet.css" rel="stylesheet" />


</head>

And this is a Random webform from the same project 这是来自同一项目的随机网络表单

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="omos.aspx.cs" Inherits="omos" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>

nothing special here as you can see, just a normal head when using Bootstrap, and one of my webforms. 如您所见,这里没有什么特别的,使用Bootstrap时只有普通的脑袋,还有我的一个Webforms。 I emptied the contentplaceholder for all my content to make it easier to read. 我清空了我所有内容的contentplaceholder,以使其更易于阅读。 if you need more information to answer the question please let me know. 如果您需要更多信息来回答问题,请告诉我。

Tekar Tekar

the second i press ask question i now realise you can change the title on the top of the web form, at " <%@ Page Title="" Language="C#" " really didnt notice it untill now. 第二个我按询问的问题,我现在意识到您可以在Web表单的顶部更改标题,直到现在at " <%@ Page Title="" Language="C#" "才真正注意到它。 sorry about this ! 为此事道歉 !

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM