Solved

html cand asp code together how?

Posted on 2008-06-10
2
847 Views
Last Modified: 2010-04-21
I am putting asp and hmtl code together.The cod eis correct but I am getting erros, please help:Although I changed the page directive as well as to one but still....

The error messages are as:
Error      1      Validation (XHTML 1.0 Transitional): Content is not supported outside 'script' or 'asp:content' regions.      
Error      2      Element 'Label' is not a known element. This can occur if there is a compilation error in the Web site.      
Error      3      Element 'CheckBox' is not a known element. This can occur if there is a compilation error in the Web site.      
Error      4      Element 'panel' is not a known element. This can occur if there is a compilation error in the Web site.      
Error      5      
ASP.NET runtime error: Only Content controls are allowed directly in a content page that contains Content controls.      
      
Error      6      There can be only one 'page' directive.      
      
Error      7      The 'uc1:NameEntry' tag has already been registered.      
      
Error      8      Only Content controls are allowed directly in a content page that contains Content controls.      


The caode is as follows:
 
 
 
 
 

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="PersonalDetails.aspx.vb" Inherits="PersonalDetails" title="Untitled Page" %>
 

<%@ Register Src="NameEntry.ascx" TagName="NameEntry" TagPrefix="uc1" %>

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

    <uc1:NameEntry ID="NameEntry3" runat="server" />

</asp:Content>
 
 
 
 
 
 
 
 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="PersonalDetails.aspx.vb" Inherits="PersonalDetails" %>
 
 
 

<%@ Register Src="NameEntry.ascx" TagName="NameEntry" TagPrefix="uc1" %>
 
 
 
 

<!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 id="Head1" runat="server">

     <title>Personal Details</title>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        &nbsp;

        <asp:Label ID="Label1" runat="server" Font-Bold="True" Height="23px" Text="Main Driver"

            Width="132px"></asp:Label>

        <br />

        <br />

        

        

        <uc1:NameEntry ID="NameEntry1" runat="server"  Visible="true"/>

         <asp:CheckBox ID="CheckBox1" runat="server" Visible="true" AutoPostBack="TRUE" Text="Additional Driver" /><br />

        <br />

        <br />

        <br />

        

 

        <asp:panel runat="server" id="pnl">

        <uc1:NameEntry ID="NameEntry2" runat="server"  Visible="false"/>

        </asp:panel>

        </div>

        

        

    </form>

</body>

</html>

Open in new window

0
Comment
Question by:mahmood_786
2 Comments
 
LVL 21

Accepted Solution

by:
naspinski earned 500 total points
ID: 21753839
I think you have this a bit messed up.  If you are using a master, you dont need and <head> or <html> tags.  

Also, you only can have one Page directive, and you have duplicate registrations as well.

Also, when you are using a masterpage, everything has to fall inside the content controls and no form declaration is needed.
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="PersonalDetails.aspx.vb" Inherits="PersonalDetails" title="Untitled Page" %>

<%@ Register Src="NameEntry.ascx" TagName="NameEntry" TagPrefix="uc1" %>

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

    <uc1:NameEntry ID="NameEntry3" runat="server" />

    <div>

        <asp:Label ID="Label1" runat="server" Font-Bold="True" Height="23px" Text="Main Driver"Width="132px"></asp:Label>

        <br /><br />

        <uc1:NameEntry ID="NameEntry1" runat="server"  Visible="true"/>

         <asp:CheckBox ID="CheckBox1" runat="server" Visible="true" AutoPostBack="TRUE" Text="Additional Driver" /><br />

        <br /><br /><br />

        <asp:panel runat="server" id="pnl">

            <uc1:NameEntry ID="NameEntry2" runat="server"  Visible="false"/>

        </asp:panel>

    </div>

</asp:Content>

Open in new window

0
 

Author Closing Comment

by:mahmood_786
ID: 31465866
I think I am messed up in head!!! need more careful thought!!See the other question if you wana answer.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Binding a check box in an Asp.net DataGrid 4 41
Rolling back a sequence of stored procedures 12 38
Syntax Error 2 47
SQL Exceptions 3 40
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now