of type 'TextBox' must be placed inside a form tag with runat=serv

G

Guest

Hi there peeps,

I am having a problem have just started to use usercontrols, and I am
hitting a problem.

I get the error message above, now each control has a table, and 1
asp:textbox control. Now when I first got this error I just put the form
tags around the table in the control with the runat=server set. But however
I get the following error if i do that too the other controls.

This is the code for the main page

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="Main_Sex_Toy_Vibrator_Rabbit.aspx.vb"
Inherits="AGS_ASPX.Main_Sex_Toy_Vibrator_Rabbit"%>
<%@ Register TagPrefix="uc1" TagName="HEADER" Src="controls/HEADER.ascx" %>
<%@ Register TagPrefix="uc1" TagName="DVD_VIDEO_EXCHANGE"
Src="controls/DVD_VIDEO_EXCHANGE.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Footer.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Main_Sex_Toy_Vibrator_Rabbit</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<uc1:HEADER id="HEADER1" runat="server"></uc1:HEADER>
<uc1:DVD_VIDEO_EXCHANGE id="DVD_VIDEO_EXCHANGE1"
runat="server"></uc1:DVD_VIDEO_EXCHANGE>
<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
</body>
</HTML>
"A page can have only one server-side Form tag."

Ok, so here is my question if I can have only one form tag, how can I have
asp: type controls on my user controls and use them, or am I just being plain
stoopid, and am doing something so simple as to be painful?

I always assumed that usercontrols would be handled by the calling pages
runat statement?
 
R

Rik Moed

Alixx,

You will have the place the text box in a form tag, like this:

<form id="Form1" method="post" runat="server">
<uc1:HEADER id="HEADER1" runat="server"></uc1:HEADER>
<uc1:DVD_VIDEO_EXCHANGE id="DVD_VIDEO_EXCHANGE1"
runat="server"></uc1:DVD_VIDEO_EXCHANGE>
</form>

Succes!
 
G

Guest

Rik,

Thankyou for your response, that fixed the problem, I had sort of answered
my own question; when I said "I always assumed that usercontrols would be
handled by the calling pages
runat statement?
" which it does except ! I hadn't made sure that my page was handling that
........ must remember to check the obvious places first. However, I have
found some interesting things out whilst researching so it wasn't a complete
waste of time.

All I can say is that your help has been very much appreciated.

Alixx
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top