Help on user controls?

Discussion in 'ASP .Net Building Controls' started by serge calderara, Nov 16, 2005.

  1. Dear all
    I have build a simple Web user control, that I have draged on a web form.
    When executed my applciation I get an error mesage saying :

    "A page can have only one server-side Form tag"

    What does that means?
    The HTML code has been generated automatically by dragging the control, I
    could not find any error.

    Here is the produce code :

    ===============================
    <%@ Register TagPrefix="uc1" TagName="LastHistory" Src="LastHistory.ascx" %>
    <%@ Page Language="vb" AutoEventWireup="false"
    Codebehind="WebLeftMargin.aspx.vb" Inherits="ServiceClient.WebLeftMargin"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <title>WebLeftMargin</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5"
    name="vs_targetSchema">
    </HEAD>
    <body bgColor="#ffcc66">
    <form id="Form1" method="post" runat="server">
    </form>
    <uc1:lasthistory id="LastHistory1" runat="server"></uc1:lasthistory>
    </body>
    </HTML>
    ============================================

    Any help will be appreciate
    Regards
    Serge
     
    serge calderara, Nov 16, 2005
    #1
    1. Advertising

  2. That was this.
    A form tag was prsent in my user control page


    "S.M. Altaf [MVP]" wrote:

    > Is there a <Form> tag in the web user control's source code?
    >
    >
    > --------------------------------------------------------------------------------
    > All that glitters has a high refractive index.
    > www.mendhak.com
    >
    >
    > "serge calderara" <> wrote in
    > message news:...
    > > Dear all
    > > I have build a simple Web user control, that I have draged on a web form.
    > > When executed my applciation I get an error mesage saying :
    > >
    > > "A page can have only one server-side Form tag"
    > >
    > > What does that means?
    > > The HTML code has been generated automatically by dragging the control, I
    > > could not find any error.
    > >
    > > Here is the produce code :
    > >
    > > ===============================
    > > <%@ Register TagPrefix="uc1" TagName="LastHistory" Src="LastHistory.ascx"
    > > %>
    > > <%@ Page Language="vb" AutoEventWireup="false"
    > > Codebehind="WebLeftMargin.aspx.vb"
    > > Inherits="ServiceClient.WebLeftMargin"%>
    > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    > > <HTML>
    > > <HEAD>
    > > <title>WebLeftMargin</title>
    > > <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    > > <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    > > <meta content="JavaScript" name="vs_defaultClientScript">
    > > <meta content="http://schemas.microsoft.com/intellisense/ie5"
    > > name="vs_targetSchema">
    > > </HEAD>
    > > <body bgColor="#ffcc66">
    > > <form id="Form1" method="post" runat="server">
    > > </form>
    > > <uc1:lasthistory id="LastHistory1" runat="server"></uc1:lasthistory>
    > > </body>
    > > </HTML>
    > > ============================================
    > >
    > > Any help will be appreciate
    > > Regards
    > > Serge

    >
    >
    >
     
    serge calderara, Nov 18, 2005
    #2
    1. Advertising

  3. It looks like your page contains one form.
    I bet your user control also contains a form.
    That would total 2 server side forms in the same page, which is not allowed
    in ASP.NET 1.x.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "serge calderara" <> wrote in
    message news:...
    > Dear all
    > I have build a simple Web user control, that I have draged on a web form.
    > When executed my applciation I get an error mesage saying :
    >
    > "A page can have only one server-side Form tag"
    >
    > What does that means?
    > The HTML code has been generated automatically by dragging the control, I
    > could not find any error.
    >
    > Here is the produce code :
    >
    > ===============================
    > <%@ Register TagPrefix="uc1" TagName="LastHistory" Src="LastHistory.ascx"
    > %>
    > <%@ Page Language="vb" AutoEventWireup="false"
    > Codebehind="WebLeftMargin.aspx.vb"
    > Inherits="ServiceClient.WebLeftMargin"%>
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    > <HTML>
    > <HEAD>
    > <title>WebLeftMargin</title>
    > <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    > <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    > <meta content="JavaScript" name="vs_defaultClientScript">
    > <meta content="http://schemas.microsoft.com/intellisense/ie5"
    > name="vs_targetSchema">
    > </HEAD>
    > <body bgColor="#ffcc66">
    > <form id="Form1" method="post" runat="server">
    > </form>
    > <uc1:lasthistory id="LastHistory1" runat="server"></uc1:lasthistory>
    > </body>
    > </HTML>
    > ============================================
    >
    > Any help will be appreciate
    > Regards
    > Serge
     
    Steve C. Orr [MVP, MCSD], Nov 19, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. trinitypete

    HTML Controls and User controls

    trinitypete, Jun 25, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    3,421
    trinitypete
    Jun 26, 2003
  2. Axel Dahmen
    Replies:
    1
    Views:
    514
    Teemu Keiski
    Nov 12, 2003
  3. Nathan Sokalski
    Replies:
    4
    Views:
    1,154
    Muhammad Naveed Yaseen
    Sep 5, 2007
  4. Faizan Ahmed
    Replies:
    1
    Views:
    299
    John Saunders
    Jan 4, 2005
  5. Faizan Ahmed
    Replies:
    1
    Views:
    376
    John Saunders
    Jan 4, 2005
Loading...

Share This Page