Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Form run at server conflict

Posted on 2009-03-30
3
Medium Priority
?
580 Views
Last Modified: 2012-06-21
I am a classic ASP guy, and now I am working on styling a .net project with css.

I have a login form and the main page and a form control on the content page.

The two conflict when I try to run the page. It says I can only have one run at server form per page.

Below is my master page code, and below that is the code snipplet of the content page.


<%@ Master Language="C#" AutoEventWireup="true" CodeFile="dlt.master.cs" Inherits="wwwroot_dlt" %>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html runat="server" xmlns="http://www.w3.org/1999/xhtml">
<script runat="server">
    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
        string userName = LoginMain.UserName;
        string password = LoginMain.Password;
        e.Authenticated = FormsAuthentication.Authenticate(userName, password);
    }
</script>
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>

    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
   
</head>
<!--[if IE]> <link type="text/css" href="dltie.css" rel="stylesheet" /> <![endif]-->
<!--[if !IE]>--> <link type="text/css" href="dltff.css" rel="stylesheet" /><!--<![endif]-->
<body>
<div id="wrapper">
<div id="header"><img src="header.jpg" width="991" height="161" border="0" usemap="#Map" />
<map name="Map" id="Map"><area shape="rect" coords="736,111,826,129" href="#" target="login.aspx" alt="login" />
<area shape="rect" coords="830,111,918,129" href="testimonials.aspx" alt="testimonials" />
<area shape="rect" coords="923,111,985,129" href="contact.aspx" alt="contact us" />
</map></div>
<div id="content">




       
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
   
   

</div>
<div id="right"><div id="loginbox"> <form runat="server">
    <asp:Login ID="LoginMain" runat="server">
    </asp:Login></form>
<div id="mlink"><A href="forgot.aspx" style="text-decoration:none;Font:Georgia, Georgia, Times, serif;font-size:11px;color:#4b718c;font-weight:200;">Forgot Your Password?</A></div></form>
</div></div>
<BR /><BR /><BR />

</div><div id="footer"><center>footer</center></div>
</body>

</html>

<form id="LMTMenu" runat="server">
    <div style="width:439px;margin-right:auto;margin-left:auto;">
        <asp:Panel ID="ReminderPanel" runat="server" Height="300px" Width="436px" BorderStyle="Solid" BorderWidth="1px" ToolTip="This will be a grid for Reminders on Leads">
           
            <asp:Calendar ID="FrontCalendar" runat="server" Height="269px" Width="423px" Caption="Appointments" ShowGridLines="True" Enabled="False"></asp:Calendar>
        </asp:Panel>
    </div>
    
    <div style="width:439px;margin-right:auto;margin-left:auto;">
    <asp:Label ID="lblSalesman" runat="server" Text="Sales Person Name :" Width="185px"></asp:Label>
        <asp:DropDownList ID="ddlSalesforce" runat="server" 
            DataTextField="SalesFullName" DataValueField="SalesmanID" OnSelectedIndexChanged= "Sales_IndexChanged"
            TabIndex="18" Width="261px">
        </asp:DropDownList>
    </div>
    
        
        
        <asp:Button ID="btnNewLead" runat="server" CausesValidation="False" 
            OnClick="btnNewLead_click"
            Text="Enter New Lead" Width="129px" />
        <asp:Button ID="btnLeadLookup" runat="server" 
            OnClick="btnLeadLookup_Click"
            Text="All Active Leads" Width="129px"  />
        <asp:Button ID="btnAssignedLeads" runat="server" 
            Text="Assigned Leads" Width="129px" OnClick="btnAssignedLeads_Click" Enabled="False" />
        <br /><asp:Button ID="btnHotLeads" runat="server" 
            Text="Hot Leads" Width="129px" OnClick="btnHotLeads_Click" />
        <asp:Button ID="btnDeadLeads" runat="server" 
            Text="Dead Leads" Width="129px" OnClick="btnDeadLeads_Click" />
        <asp:Button ID="btnSoldLeads" runat="server" 
            Text="Sold Leads" Width="129px" OnClick="btnSoldLeads_Click" />
       
        
        <asp:HiddenField ID="HFdSalesmanID" runat="server" />
        <asp:LoginStatus ID="LoginStatus1" runat="server" Width="75px" />
        <asp:HiddenField ID="HFdPageNumber" runat="server" />
        <asp:LoginName ID="LoginName1" runat="server" Width="147px" />
        <asp:HiddenField ID="HFdCompanyCode" runat="server" />
        
 </div>
 </form>

Open in new window

0
Comment
Question by:poweraddict
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Expert Comment

by:Ajay Sharma
ID: 24026090
While using asp.net only one Form tag is accepted to run at server.
As the master page is having the FORM tag already so remove the FROM tag from content page.

Remove the below line from the content Page
   <form id="LMTMenu" runat="server">
also remove the    </form>  as this is the closing tag.
0
 
LVL 6

Author Comment

by:poweraddict
ID: 24052653
I tried, but by doing that, the calender control doesn't work. Am I correct?
0
 
LVL 18

Accepted Solution

by:
Ajay Sharma earned 800 total points
ID: 24058747
No, after removing the Form tag from content page every control must work.
As you are saying that calender is not working after removing Form tag, it should not happen.

Post you code after removing the Form code.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

705 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