user5067119 user5067119 - 5 months ago 32
ASP.NET (C#) Question

Getting A page can have only one server-side Form tag Error

I have done my

and create a new
page with this
. but whenever I try to add a
to the
page it's generate to me this error:

Control 'head_ctl00' of type 'RadioButton' must be placed inside a
form tag with runat=server.

and I have tried to add a form tag and this error came out !

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

I'm confused how I can solve this problem ! any idea ?

in case you need my
page :

<%@ Page Title="" Language="C#" MasterPageFile="~/MySite.Master" AutoEventWireup="true" CodeBehind="Registration.aspx.cs" Inherits="MyWebsite.Registration" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<form id="frm" runat="server">
<asp:RadioButton runat="server"></asp:RadioButton>


You have inserted your RadioButton inside the head placeholder that has not the form tag in your MasterPage file. You should place RadioButton in another PlaceHolder like MainContent or FeaturedContent. Also you don't need the form tag in your ContentPages, The form tag on the master page will be sufficient.