请解决这个问题.我收到以下错误
一个页面只能有一个服务器端Form标记.
说明:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息.
异常详细信息:System.Web.HttpException:一个页面只能有一个服务器端Form标记.
源错误:
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.
堆栈跟踪:
Stack Trace:
[HttpException (0x80004005): A page can have only one server-side Form tag.]
System.Web.UI.Page.OnFormRender() +2074345
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +28
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +26
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558
OP的评论:
我正在尝试运行以下项目
http://www.planet- source-code.com/vb/scripts/ShowZip.asp?lngWId=10&lngCodeId=424&strZipAccessCode=tp%2FS4245672 [
Comment from OP:
I''m trying to run the following project
http://www.planet-source-code.com/vb/scripts/ShowZip.asp?lngWId=10&lngCodeId=424&strZipAccessCode=tp%2FS4245672[^]
您是否正在使用用户控件?
您正在使用母版页吗?
听起来您最终在渲染的输出上带有2个Form标记,请检查您正在调用的控件/页面以及最终DOM的堆积方式.
您是否已将表单放入用户控件,然后在已经具有表单标签的页面中调用了它.
您是否调用了具有表单控件的页面,并附加了还包含表单标签的母版页.
这些是可能要检查的事情.
Are you using usercontrols?
Are you using masterpages?
Sounds like you have ended up with 2 Form tags on the rendered output, check which controls/pages you are calling and how the final DOM is stacking up.
have you put a form into a user control and then called that in a page that already has a form tag.
have you called a page that has a form control and attached a master page that also contains a form tag.
These are the likely things to check.
它清楚地表明了A page can have only one server-side Form tag.
您的页面中必须有两个<form></form>
标记.正确检查.
As it clearly saysA page can have only one server-side Form tag.
You must be having two<form></form>
tags in your page. Check it properly.