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

Posted by Thiru under Regular Expressions on 6/8/2011 | Points: 10 | Views : 7971 | Status : [Member] | Replies : 1
Showing Error as: A page can have only one server-side Form tag.
Let me know where i made the mistake.

Expecting your valuable reply

<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/BasicTutor.Master" CodeBehind="HandlingServerControlEvents.aspx.vb" Inherits="WhileLearning.WebForm1" 
title="HandlingServerControlEvents" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script language="VB" runat="server">
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
Message.Text = "Hi " & HttpUtility.HtmlEncode(Name.Text) & ", you selected: " & Category.SelectedItem.Text
End Sub
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<form id="Form1" action="HandlingServerControlEvents.aspx" method="post" runat="server">
<asp:adrotator ID="Adrotator1" AdvertisementFile="ads.xml" BorderColor="black" BorderWidth="1" runat="server"/>
<h3> Name: <asp:textbox id="Name" runat="server"/>
Category: <asp:dropdownlist id="Category" runat="server">
<asp:listitem >psychology</asp:listitem>
<asp:listitem >business</asp:listitem>
<asp:listitem >popular_comp</asp:listitem>
<asp:button ID="Button1" text="Lookup" OnClick="SubmitBtn_Click" runat="server"/>
<br />
<asp:label id="Message" runat="server"/>


Posted by: Thiru on: 6/8/2011 [Member] Starter | Points: 25



A page can have only one server-side Form tag.
Here it will trigger one form tag as from master page and another from content page.

Solution is: Have to remove form tag from master page

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response