如何清除错误对我有帮助 [英] How to clear the error help me

查看:60
本文介绍了如何清除错误对我有帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在网页中进行设计

我的错误

一个页面只能有一个服务器端Form标记.
说明:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息.

异常详细信息:System.Web.HttpException:一个页面只能有一个服务器端Form标记.

源错误:
当前Web请求的执行期间生成了未处理的异常.可以使用下面的异常堆栈跟踪来标识有关异常的来源和位置的信息.

<%@ Page Language="C#" AutoEventWireup="true"  MasterPageFile="~/MasterPage.master" CodeFile="MainPage.aspx.cs" Inherits="PhotoStudio.MainPage"  %>
 

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>



<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server" ID="ContentPlaceHolder1">



<form  runat="server">
   
    <div style="width:100%;    border:1px   solid #009900;  background-color:#E4E4E4">
	 
 
       
   
   
    <div style="height: 267px; width: 549px">
    <table width="100%">
        
    <tr><td>Bill No     :<asp:Label ID="lblBillNo" 
            runat="server">
                    </td><td class="style1" colspan="2"><asp:TextBox ID="txtBillNo" runat="server" 
                Visible=false Width="122px"></td><td class="style2"> </td><td>
         </td></tr>
    <tr><td>Customer Name :</td>
       <td class="style1" colspan="2"> <asp:TextBox ID="txtCName" runat="server"></td>
       <td class="style2">  </td>
       <td>  </td></tr><tr>
        <td>Phone No :</td><td class="style1" colspan="2"><asp:TextBox ID="txtPhone" runat="server"></td>
        <td class="style2"> </td><td> </td></tr>
    <tr><td> Date :</td><td class="style1" colspan="2"><telerik:RadDatePicker ID="rdStartDate"   runat="server">
       
                    </td><td class="style2"> </td><td> </td></tr><tr><td>Delivery Date :</td>
        <td class="style1" colspan="2">
                        <telerik:RadDatePicker ID="rdEndDate"  runat="server">
                        
                    </td><td class="style2">
                         </td><td>
                         </td></tr><tr><td>System URL :</td><td class="style1">
                colspan="2">
                        <asp:FileUpload ID="browseFilepath" runat="server" /></td>
            <td class="style2">
                         </td><td>
                         </td></tr>

<tr><td>
    <asp:GridView ID="DisplayGrid" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" ForeColor="#333333" GridLines="None" 
        onrowdeleting="GridView1_RowDeleting" 
        onselectedindexchanged="DisplayGrid_SelectedIndexChanged" ShowFooter="True" 
        Width="468px">
        <footerstyle backcolor="#507CD1" font-bold="True" forecolor="White" />
        <rowstyle backcolor="#EFF3FB" />
        <columns>
            <asp:BoundField DataField="Size" HeaderText="Size" InsertVisible="False" 
                Visible="False" />
            <asp:TemplateField HeaderText="Size">
                <itemtemplate>
                    <asp:Label ID="lblSize" runat="server" Text=''<%# Bind("Size") 

%>''>
                </itemtemplate>
            
            <asp:TemplateField HeaderText="No Of Copies">
                <itemtemplate>
                    <asp:Label ID="lblNoofcopies" runat="server" Text=''<%# 

Bind("Noofcopies") %>''>
                </itemtemplate>
            
            <asp:TemplateField HeaderText="Amount">
                <itemtemplate>
                    <asp:Label ID="lblAmount" runat="server" Text=''<%# 

Bind("Amount") %>''>
                </itemtemplate>
            
            <asp:TemplateField HeaderText="Total">
                <itemtemplate>
                    <asp:Label ID="lblTotal" runat="server" Text=''<%# Bind("Total") 

%>''>
                </itemtemplate>
            
            <asp:CommandField HeaderText="Delete" ShowDeleteButton="True" />
        </columns>
        <pagerstyle backcolor="#2461BF" forecolor="White" horizontalalign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <editrowstyle backcolor="#2461BF" />
        <alternatingrowstyle backcolor="White" />
        <emptydatatemplate>
            No Record
        </emptydatatemplate>
    
    </td><td class="style1" colspan="2"> </td>
             <td class="style2"> </td>
             <td> </td>
             </tr>
         <br />
         <br />
         <tr><td>
              </td>
             <td class="style1">
                  </td>
             <td class="style1">
                  </td>
             <td class="style2">
                  </td>
             <td>
                  </td></tr>
         
        <tr><td>Size :</td><td class="style1" colspan="2">
            <asp:DropDownList ID="cmbSize" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="cmbSize_SelectedIndexChanged">
            
        </td><td class="style2">
                 </td><td>
                 </td></tr>
         
        <tr><td>Amount :</td><td class="style1" colspan="2">
                        <asp:TextBox ID="txtAmt" runat="server" 
                        >
        </td><td class="style2">
                             </td><td>
                             </td></tr><tr><td>Extra Copies :</td><td class="style1">
                colspan="2">
            <asp:TextBox ID="txtNoofcopies" runat="server"  AutoPostBack="true"
                      ></td>
            <td class="style2">
                 </td><td class="style3">
                             </td></tr>
            <tr><td> Extra Copy Amount :</td><td class="style1" colspan="2">
                        <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="true" ontextchanged="TextBox1_TextChanged">
                        </td><td class="style2"> </td><td> </td>
            <tr><td>
                Total</td><td class="style1" colspan="2">
            <asp:TextBox ID="txtTot"  runat="server"  AutoPostBack="true">
                        </td><td class="style2"> </td><td> </td>
            <tr><td>
                <asp:Label ID="Label3" runat="server" Text="Lamination">
                </td><td class="style1" colspan="2">
                        <asp:DropDownList ID="Ddl" runat="server">
                                     
                        </td><td class="style2"> </td><td> </td><tr><td class="style4">
                <asp:Label ID="Label4" runat="server" Text="Lamination Amount">
                </td>
        <td class="style1" colspan="2">
                        <asp:TextBox ID="txtlami" runat="server" AutoPostBack="true" 
                            ontextchanged="txtlami_TextChanged" >
                        </td><td class="style2">
             </td><td class="style3"> </td></tr>
            <tr><td><asp:Label ID="Label1" runat="server" Text="Grand Total : " Font-Bold="true" Font-Size="Medium" 

>
                </td>
                <td class="style1" colspan="2">
                    <asp:TextBox ID="txtgrandtot" runat="server"  AutoPostBack="true"
                       >
                </td>
                <td class="style2"> </td>
                <td> </td>
                <td>
                     </td></tr>
            <tr><td>
                <asp:Label ID="Label2" runat="server" Text="Paid Amount">
                </td>
                <td class="style1" colspan="2">
             <asp:TextBox ID="txtPaid" runat="server" ontextchanged="txtPaid_TextChanged"></td>
                <td class="style2"> </td>
                <td> </td>
                <td>
                     </td></tr>
            <tr><td>Balance</td>
                <td class="style1" colspan="2">
                    <asp:TextBox ID="txtbalance" runat="server" 
                       >
                        </td>
                <td class="style2"> </td>
                <td> </td>
                <td>
                     </td></tr>
            <tr><td>
                <asp:Button ID="btnAdd" runat="server" Text="Add" onclick="btnAdd_Click" /><asp:Button ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" />
                    <asp:Button ID="btnClear" runat="server" Text="Clear" 
            onclick="btnClear_Click" /></td>
                <td class="style1" colspan="2"> </td>
                <td class="style2"> </td>
                <td> </td>
                <td>
                     </td></tr></tr></tr></tr></table>
             
 <br />
            <asp:ImageButton ID="imgPrint" runat="server" ImageUrl="~/images/print.jpg" 
            onclick="imgPrint_Click" />
<br />
 
              
    <asp:Label ID="lblError" runat="server" Text="">
        
    </div>
    
   
    </div>
		
		</form>

解决方案

您是否已在源文件中添加了两个标签.

每个aspx只允许使用一个标签.
删除多余的标签,然后尝试. .aspx)删除当前网页的表单标签,即删除

 <  表单      runat   =" 服务器"  <  /form   >  



谢谢,
hemant


为什么在这里添加了form 标签?您正在使用Master 页面!不需要form 标签.只需删除它即可.


I have designing in my web page

My error

A page can have only one server-side Form tag.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: A page can have only one server-side Form tag.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

<%@ Page Language="C#" AutoEventWireup="true"  MasterPageFile="~/MasterPage.master" CodeFile="MainPage.aspx.cs" Inherits="PhotoStudio.MainPage"  %>
 

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>



<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server" ID="ContentPlaceHolder1">



<form  runat="server">
   
    <div style="width:100%;    border:1px   solid #009900;  background-color:#E4E4E4">
	 
 
       
   
   
    <div style="height: 267px; width: 549px">
    <table width="100%">
        
    <tr><td>Bill No     :<asp:Label ID="lblBillNo" 
            runat="server">
                    </td><td class="style1" colspan="2"><asp:TextBox ID="txtBillNo" runat="server" 
                Visible=false Width="122px"></td><td class="style2"> </td><td>
         </td></tr>
    <tr><td>Customer Name :</td>
       <td class="style1" colspan="2"> <asp:TextBox ID="txtCName" runat="server"></td>
       <td class="style2">  </td>
       <td>  </td></tr><tr>
        <td>Phone No :</td><td class="style1" colspan="2"><asp:TextBox ID="txtPhone" runat="server"></td>
        <td class="style2"> </td><td> </td></tr>
    <tr><td> Date :</td><td class="style1" colspan="2"><telerik:RadDatePicker ID="rdStartDate"   runat="server">
       
                    </td><td class="style2"> </td><td> </td></tr><tr><td>Delivery Date :</td>
        <td class="style1" colspan="2">
                        <telerik:RadDatePicker ID="rdEndDate"  runat="server">
                        
                    </td><td class="style2">
                         </td><td>
                         </td></tr><tr><td>System URL :</td><td class="style1">
                colspan="2">
                        <asp:FileUpload ID="browseFilepath" runat="server" /></td>
            <td class="style2">
                         </td><td>
                         </td></tr>

<tr><td>
    <asp:GridView ID="DisplayGrid" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" ForeColor="#333333" GridLines="None" 
        onrowdeleting="GridView1_RowDeleting" 
        onselectedindexchanged="DisplayGrid_SelectedIndexChanged" ShowFooter="True" 
        Width="468px">
        <footerstyle backcolor="#507CD1" font-bold="True" forecolor="White" />
        <rowstyle backcolor="#EFF3FB" />
        <columns>
            <asp:BoundField DataField="Size" HeaderText="Size" InsertVisible="False" 
                Visible="False" />
            <asp:TemplateField HeaderText="Size">
                <itemtemplate>
                    <asp:Label ID="lblSize" runat="server" Text=''<%# Bind("Size") 

%>''>
                </itemtemplate>
            
            <asp:TemplateField HeaderText="No Of Copies">
                <itemtemplate>
                    <asp:Label ID="lblNoofcopies" runat="server" Text=''<%# 

Bind("Noofcopies") %>''>
                </itemtemplate>
            
            <asp:TemplateField HeaderText="Amount">
                <itemtemplate>
                    <asp:Label ID="lblAmount" runat="server" Text=''<%# 

Bind("Amount") %>''>
                </itemtemplate>
            
            <asp:TemplateField HeaderText="Total">
                <itemtemplate>
                    <asp:Label ID="lblTotal" runat="server" Text=''<%# Bind("Total") 

%>''>
                </itemtemplate>
            
            <asp:CommandField HeaderText="Delete" ShowDeleteButton="True" />
        </columns>
        <pagerstyle backcolor="#2461BF" forecolor="White" horizontalalign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <editrowstyle backcolor="#2461BF" />
        <alternatingrowstyle backcolor="White" />
        <emptydatatemplate>
            No Record
        </emptydatatemplate>
    
    </td><td class="style1" colspan="2"> </td>
             <td class="style2"> </td>
             <td> </td>
             </tr>
         <br />
         <br />
         <tr><td>
              </td>
             <td class="style1">
                  </td>
             <td class="style1">
                  </td>
             <td class="style2">
                  </td>
             <td>
                  </td></tr>
         
        <tr><td>Size :</td><td class="style1" colspan="2">
            <asp:DropDownList ID="cmbSize" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="cmbSize_SelectedIndexChanged">
            
        </td><td class="style2">
                 </td><td>
                 </td></tr>
         
        <tr><td>Amount :</td><td class="style1" colspan="2">
                        <asp:TextBox ID="txtAmt" runat="server" 
                        >
        </td><td class="style2">
                             </td><td>
                             </td></tr><tr><td>Extra Copies :</td><td class="style1">
                colspan="2">
            <asp:TextBox ID="txtNoofcopies" runat="server"  AutoPostBack="true"
                      ></td>
            <td class="style2">
                 </td><td class="style3">
                             </td></tr>
            <tr><td> Extra Copy Amount :</td><td class="style1" colspan="2">
                        <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="true" ontextchanged="TextBox1_TextChanged">
                        </td><td class="style2"> </td><td> </td>
            <tr><td>
                Total</td><td class="style1" colspan="2">
            <asp:TextBox ID="txtTot"  runat="server"  AutoPostBack="true">
                        </td><td class="style2"> </td><td> </td>
            <tr><td>
                <asp:Label ID="Label3" runat="server" Text="Lamination">
                </td><td class="style1" colspan="2">
                        <asp:DropDownList ID="Ddl" runat="server">
                                     
                        </td><td class="style2"> </td><td> </td><tr><td class="style4">
                <asp:Label ID="Label4" runat="server" Text="Lamination Amount">
                </td>
        <td class="style1" colspan="2">
                        <asp:TextBox ID="txtlami" runat="server" AutoPostBack="true" 
                            ontextchanged="txtlami_TextChanged" >
                        </td><td class="style2">
             </td><td class="style3"> </td></tr>
            <tr><td><asp:Label ID="Label1" runat="server" Text="Grand Total : " Font-Bold="true" Font-Size="Medium" 

>
                </td>
                <td class="style1" colspan="2">
                    <asp:TextBox ID="txtgrandtot" runat="server"  AutoPostBack="true"
                       >
                </td>
                <td class="style2"> </td>
                <td> </td>
                <td>
                     </td></tr>
            <tr><td>
                <asp:Label ID="Label2" runat="server" Text="Paid Amount">
                </td>
                <td class="style1" colspan="2">
             <asp:TextBox ID="txtPaid" runat="server" ontextchanged="txtPaid_TextChanged"></td>
                <td class="style2"> </td>
                <td> </td>
                <td>
                     </td></tr>
            <tr><td>Balance</td>
                <td class="style1" colspan="2">
                    <asp:TextBox ID="txtbalance" runat="server" 
                       >
                        </td>
                <td class="style2"> </td>
                <td> </td>
                <td>
                     </td></tr>
            <tr><td>
                <asp:Button ID="btnAdd" runat="server" Text="Add" onclick="btnAdd_Click" /><asp:Button ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" />
                    <asp:Button ID="btnClear" runat="server" Text="Clear" 
            onclick="btnClear_Click" /></td>
                <td class="style1" colspan="2"> </td>
                <td class="style2"> </td>
                <td> </td>
                <td>
                     </td></tr></tr></tr></tr></table>
             
 <br />
            <asp:ImageButton ID="imgPrint" runat="server" ImageUrl="~/images/print.jpg" 
            onclick="imgPrint_Click" />
<br />
 
              
    <asp:Label ID="lblError" runat="server" Text="">
        
    </div>
    
   
    </div>
		
		</form>

解决方案

Have u added two tag in your source file.

Only one Tag is allowed per aspx.
Remove extra tag and try.


you have a master page (i.e. MasterPage.master) and that will contain a form tag and you have added a form tag in your current page also (i.e. MainPage.aspx) remove current web page''s form tag i.e. remove

<form  runat="server">


and

</form>



Thanks,
hemant


How come the form tag added here? You are using a Master page ! No need to have the form tag.Just get rid of it.


这篇关于如何清除错误对我有帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆