SORU
7 Mayıs 2009, PERŞEMBE


Ana Sayfa Tuhaflık - "İçerik denetimi içerik sayfası veya ana sayfa. başvuran iç içe geçmiş bir ana sayfasındaki en üst düzey denetimler olmalıdır&"

Bu garip. Visual Studio 2008'de benim çözüm için yeni bir Web Uygulama proje ekledim.

Ana Sayfa oluşturdu. Sıfır bir değişiklik yapılamaz. Yeni bir web formunu oluşturdu. MP sadece oluşturulmuş olan Anasayfa ayarlayın.

Yine de, hiçbir değişiklik. Hayır biçimlendirme. Kullanıcı denetimleri. Referansım yok. Hiçbir şey. Bunu çalıştırmak için çalıştığınızda, ancak, ben

Content controls have to be top-level controls in a content page or a nested master page that references a master page.
HttpException (0x80004005): Content controls have to be top-level controls in a content page or a nested master page that references a master page.]
   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)  8665016
   System.Web.UI.Page.get_Master()  51
   System.Web.UI.Page.ApplyMasterPage()  15
   System.Web.UI.Page.PerformPreInit()  45
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  282

Eğer tek başına bir proje içinde aynı şeyi yaparsam bu çözüm dışında bu kadar, gayet iyi çalışıyor. Web uygulaması projesi vs olması neyi değiştirir eğer bir web sitesi projesi kullanıyorum unutmayın.

Bu web formunu:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebUI._Default" MasterPageFile="~/Site1.Master" %>

<!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>
    </form>
</body>
</html>

Ana Sayfa:

<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site1.master.vb" Inherits="WebUI.Site1" %>

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

        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

CEVAP
7 Mayıs 2009, PERŞEMBE


Web form biçimlendirme (<html> etiketi gibi) olmamalı. Bir ana sayfa sahip olduğu için, sadece içeriği etiketi ile başlayın. SEO sayfanızı bu gibi görünmelidir:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebUI._Default" MasterPageFile="~/Site1.Master" %>

<asp:content id="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   This is the body!
</asp:content>

Yeni SEO sayfası açık olduğundan emin olun "" "yeni öğe" iletişim Ekle Ana Sayfa seçin eklerken

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • GavinMichaelBooth

    GavinMichael

    26 AĞUSTOS 2006
  • sghaff1

    sghaff1

    23 Mart 2009
  • The Pet Collective

    The Pet Coll

    5 Ocak 2012