2013-08-22 12 views
9

ho pagina e aggiungere l'estensione Ajax ma errore di lancio per meIn questa pagina manca un controllo HtmlHead necessario per il collegamento del foglio di stile CSS che viene aggiunto. Si prega di aggiungere <runat = "server"/head>

sto usando pagina master in modo da questa pagina non ha <head>

codice della pagina

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

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" runat="server" %> 


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

    <table style="width: 100%"> 
    <tr> 
     <td colspan="5" style="text-align: center; height: 20px;">Search </td> 
    </tr> 
    <tr> 
     <td style="text-align: center; height: 20px;">Ticket number</td> 
     <td style="text-align: center; height: 20px;">Client name</td> 
     <td style="text-align: center; height: 20px;">Address</td> 
     <td style="text-align: center; height: 20px;">Assigned to</td> 
     <td style="text-align: center; height: 20px;">Date</td> 
    </tr> 
    <tr> 
     <td style="width: 157px"> 
      <asp:TextBox ID="txt_incID" runat="server" Width="146px"></asp:TextBox> 
     </td> 
     <td> 
      <asp:TextBox ID="txb_ClientName" runat="server" Width="146px"></asp:TextBox> 
     </td> 
     <td> 
      <asp:DropDownList ID="ddl_Address" runat="server" Width="146px" DataSourceID="Ds_address" DataTextField="StrName" DataValueField="StrID"> 
       <asp:ListItem Value="null"></asp:ListItem> 
      </asp:DropDownList> 
     </td> 
     <td> 
      <asp:DropDownList ID="ddl_EmpID" runat="server" Width="146px" DataSourceID="DS_Employee" DataTextField="LastName" DataValueField="EmpID"> 
       <asp:ListItem Value="null"></asp:ListItem> 
      </asp:DropDownList> 
     </td> 
     <td> 
      <asp:TextBox ID="txb_date" runat="server" Width="146px"></asp:TextBox> 

      <asp:CalendarExtender ID="txb_date_CalendarExtender" runat="server" Enabled="True" TargetControlID="txb_date"> 
      </asp:CalendarExtender> 

     </td> 
    </tr> 
    <tr> 
     <td style="width: 157px">&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
    </tr> 
    <tr> 
     <td style="width: 157px">&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
     <td>&nbsp;</td> 
    </tr> 
</table> 

    <br /> 
    <br /> 
    <asp:SqlDataSource ID="Ds_address" runat="server" ConnectionString="<%$ ConnectionStrings:TicketsConnectionString %>" SelectCommand="SELECT * FROM [Streets]"></asp:SqlDataSource> 
    <asp:SqlDataSource ID="DS_Employee" runat="server" ConnectionString="<%$ ConnectionStrings:TicketsConnectionString %>" SelectCommand="SELECT * FROM [Employee]"></asp:SqlDataSource> 
    <asp:ScriptManager ID="ScriptManager1" runat="server"> 
    </asp:ScriptManager> 

</asp:Content> 

in altri argomenti raccomandano aggiungere questo

<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>

ma ce l'ho sulla mia pagina. Qualche idea su come risolvere?
Maestro codice della pagina

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta name="keywords" content="" /> 
<meta name="description" content="" /> 
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
<title>Tickets</title> 
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700|Archivo+Narrow:400,700" rel="stylesheet" type="text/css"> 
<link href="style.css" rel="stylesheet" type="text/css" media="screen" /> 
    <style type="text/css"> 
     .Buttons 
     { 
      font-family: Tahoma; 
      font-size: large; 
      background-color: #999999; 
      border-bottom-color: #FF0000; 
      border-style: none none outset none; 
     } 
     .Logins 
     { 
      font-family: tahoma; 
      color: #FF0000; 
     } 
     .ButtonsInSite 
     { 
      font-family: tahoma; 
      background-color: #C0C0C0; 
      border-color: #FFFFFF #FFFFFF #FF0000 #FFFFFF; 
      border-bottom-style: double; 
      border-radius: 7px; 
      -moz-border-radius: 7px; 
      -webkit-border-radius: 7px; 
      box-shadow: 0px 2px 9px #800000; 
      font-weight: bold; 
     } 
    </style> 
    </head> 
<body> 
    <form id="form1" runat="server"> 
<div id="header-wrapper"> 
    <div id="header"> 
     <div id="logo"> 
      <h1>Tickets</h1> 
      <div style="text-align: right"> 

       <asp:LoginName ID="LoginName2" runat="server" CssClass="Logins" /> 
       &nbsp;| 
       <asp:LoginStatus ID="LoginStatus1" runat="server" CssClass="Logins" /> 
      </div> 
     </div> 
    </div> 
</div> 
<div id="wrapper"> 
    <!-- end #header --> 
    <div id="page"> 
     <div id="page-bgtop"> 
      <div id="page-bgbtm"> 
       <div id="sidebar"> 
        <h2>Navigation</h2> 
        <asp:Button ID="Button1" runat="server" Text="Button" Width="118px" CssClass="ButtonsInSite" /> 
        <br /> 
        <asp:Button ID="Button2" runat="server" Text="Button" Width="118px" CssClass="ButtonsInSite"/> 
        <br /> 
        <asp:Button ID="Button3" runat="server" Text="Button" Width="118px" CssClass="ButtonsInSite"/> 
        <br /> 
        <asp:Button ID="Button4" runat="server" Text="Button" Width="118px" CssClass="ButtonsInSite"/> 
        <br /> 
        <asp:Button ID="Button5" runat="server" Text="Admin" Width="118px" CssClass="ButtonsInSite" PostBackUrl="~/Admin/AdmStart.aspx"/> 
        <br /> 


       </div> 
       <!-- end #sidebar --> 
       <div id="content"> 
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> 
        </asp:ContentPlaceHolder> 
       </div> 
       <!-- end #content --> 

       <div style="clear: both;">&nbsp;</div> 
      </div> 
     </div> 
    </div> 
    <!-- end #page --> 
</div> 
<div id="footer"> 
    <p> © 2013</p> 
</div> 
<!-- end #footer --> 
    </form> 
</body> 
</html> 
+0

Potrebbe aggiungere il codice per la pagina principale, per favore? – nmat

+0

@nmat Codice di pagina principale aggiunto – Andrey

risposta

4

Può essere questo vi aiuterà. Maestro pagina Html

<asp:ContentPlaceHolder ID="head" runat="server"> 
</asp:ContentPlaceHolder> 

    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> 
</asp:ContentPlaceHolder> 

Bambino pagina HTML

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">Add Scripts here</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> 
Add Page Content Here</asp:Content> 
0

si può aggiungere <head runat="server"> alla pagina master ??

+0

sì di inizio caricamento pagina ma ajaxt non funziona :( – Andrey

0

in Master pagina Aggiungi

<head id="Head1" runat="server"> 
//Other script 

<asp:ContentPlaceHolder ID="head" runat="server"> 
    </asp:ContentPlaceHolder> 
</head> 

Nella pagina figlio aggiungere

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> 
//add script for child page 
<script> 
</script> 
</asp:Content> 
0

Prova questa

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
2

Aggiungi nella pagina master

<head runat="server"> 
+1

È possibile espandere questo? Cosa farà? Perché questo aiuto? Qualsiasi documentazione per il backup? –

+0

A causa di alcuni interni problema causato dalla masterpage non sta inizializzando il tag head nella pagina figlio, quindi lo facciamo runat = "server" in modo che possa accedervi –

+0

Non ti sto chiedendo di elaborare per me, ti sto chiedendo se potresti migliorare la tua risposta con la modifica per aggiungere tali dettagli. Ciò renderà la tua risposta più utile per i futuri lettori. –

1

In una pagina figlio ContentPlaceHolderID intestazione basta aggiungere <head runat="server"></head>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2Header" runat="Server"> 
    <head runat="server"> 
    </head> 
    <script src="http://code.jquery.com/jquery-latest.min.js" 
     type="text/javascript"></script> 
</asp:Content> 
0

nel codice MASTER PAGINA! Basta sostituire <head> per <head id="head1" runat="server">

Problemi correlati