I guess you have used update panel, for this work. if Yes then makesure your form tag is out side the update panel. otherwise it willthrow the same error.
cheers
Are you using Master Pages? If you provide some code examples of your page it will be easier to help.
If you are using Master Pages, this ASP.NET thread may help:http://forums.asp.net/thread/872772.aspx
Cheers,
Al
I am using master page.
<%
@.PageLanguage="C#"AutoEventWireup="true"CodeFile="Order.aspx.cs"MasterPageFile="~/MasterPage.master"Inherits="Order" %><
asp:ContentID="Content"ContentPlaceHolderID="ContentPlaceHolder"runat="Server"><formid="QuoteForm"runat="server"defaultbutton="btnQuote"><asp:ScriptManagerID="smScriptManager"runat="server"></asp:ScriptManager><tablewidth="100%"border="0"cellspacing="0"cellpadding="3"><tr><tdwidth="550"align="left">...some more code....
<
tr><tdstyle="padding: 0px;"><asp:UpdatePanelID="upTradeInUpdatePanel"runat=serverUpdateMode="conditional"><ContentTemplate><fieldsetstyle="border-style:none"><tablerunat="server"width="100%"cellpadding="3"cellspacing="0"border="0"><tr><tdcolspan="2"style="height:16px; color:Red; vertical-align:top;"><asp:UpdateProgressDynamicLayout="true"AssociatedUpdatePanelID="upTradeInUpdatePanel"runat="server"><ProgressTemplate><asp:Imagerunat="server"ImageUrl="~/images/indicator1.gif"/> <b>Loading...</b></ProgressTemplate></asp:UpdateProgress></td></tr><tr><tdstyle="width: 427px"colspan="2"><aname="quoteform1"></a><arunat="server"href=""id="lnkProdCategory">Product Category:</a><br><asp:DropDownListID="cboCategory"runat="server"AutoPostBack="True"OnSelectedIndexChanged="cboCategory_SelectedIndexChanged"></asp:DropDownList><asp:RequiredFieldValidatorID="rfvCategory"runat="server"ControlToValidate="cboCategory"Display="Dynamic"ErrorMessage="Please select trade-in category"ValidationGroup="addproduct"InitialValue="0"></asp:RequiredFieldValidator></td></tr><tr><td><ahref=""runat="server"id="lnkManufacturer">Manufacturer:</a><br><asp:DropDownListID="cboManufacturer"runat="server"AutoPostBack="True"OnSelectedIndexChanged="cboManufacturer_SelectedIndexChanged"></asp:DropDownList><asp:RequiredFieldValidatorID="rfvManufacturer"runat="server"ControlToValidate="cboManufacturer"Display="Dynamic"ErrorMessage="Please select trade-in manufacturer"ValidationGroup="addproduct"InitialValue="0"></asp:RequiredFieldValidator></td></tr><tr><td><ahref=""id="lnkModel"runat="server">Model:</a><br><asp:DropDownListID="cboProduct"runat="server"></asp:DropDownList><asp:RequiredFieldValidatorID="rfvProduct"runat="server"ControlToValidate="cboProduct"Display="Dynamic"ErrorMessage="Please select trade-in model"ValidationGroup="addproduct"InitialValue="0"></asp:RequiredFieldValidator><asp:TextBoxID="txtModelDescription"runat="server"Visible="false"CssClass="TextBox"></asp:TextBox><asp:CustomValidatorID="cvModelDescription"runat="server"ClientValidationFunction="ValidateModelDescription"ControlToValidate="txtModelDescription"ErrorMessage="Please enter a valid model description"Enabled="false"ValidationGroup="addproduct"Display="Dynamic"></asp:CustomValidator><asp:RequiredFieldValidatorID="rfvModelDescription"runat="server"Display="Dynamic"ControlToValidate="txtModelDescription"ValidationGroup="addproduct"ErrorMessage="Please enter model description"Enabled="false"></asp:RequiredFieldValidator></td></tr><tr><td><aid="lnkQuantity"href=""runat="server">Quantity:</a><br><asp:TextBoxrunat="server"ID="txtQuantity"Width="51px"MaxLength="4"CssClass="TextBox"></asp:TextBox><asp:RequiredFieldValidatorID="rfvQuantity"runat="server"ControlToValidate="txtQuantity"ErrorMessage="Please enter quantity"ValidationGroup="addproduct"></asp:RequiredFieldValidator><br/><asp:CustomValidatorValidationGroup="addproduct"ID="cvQuantity"runat="server"ClientValidationFunction="ValidateQty"ControlToValidate="txtQuantity"ErrorMessage="Please enter whole numbers in quantity"Display="Dynamic"></asp:CustomValidator></td></tr>
</table></fieldset></ContentTemplate></asp:UpdatePanel></td></tr>
...some more code....
</
table></form></
asp:Content>do one thing, check if you master page already contain a form tag.if not then remove it from your child page and put it on masterpage.ifyes then remove it from your child pages
cheers
On master page there is a form tag
<form action="http://xyzxyzxyz.com/" method="GET" ID="Form2">
On the child page I am using
<form id="QuoteForm" runat="server" defaultbutton="btnQuote">
I have already tried removing the master page <form>. but no use.
Does your Master Page form tag need the action and GET method in it?
If you take out the child page form tag and simply use a default looking form tag like
<
formid="form1"runat="server">in your Master page does it work? Try adding the runat=server to your Master Page form. If you need to be posting back to another page, you can also try using the CrossPagePostBack documented here:http://quickstarts.asp.net/QuickStartv20/aspnet/doc/tipstricks/default.aspx
Al
Dear I was asking you to remove the child form. and also remove method element from master page form tag. just to check.
cheers
I can not remove child page form because lots of server controls are there in the child page. Still the error occurs. Now I am trying to find out if this is related to domain because the same thing is working on development environment.
The server controls in the child page will all still work with the FORM in the master page. ASP.NET will process all the server controls on a page that are within the <FORM> tag, so if you're Master page has the <FORM> tag and your child content exists within that, then all your server controls will all work and post back correctly and be accessible from the server side.
Here is a great article onMaster Pages In ASP.NET 2.0:
http://www.odetocode.com/Articles/419.aspx
No comments:
Post a Comment