您的位置:首页 > 编程语言 > ASP

Control 'ctl00_Menu1' of type 'Menu' must be placed inside a form tag with runat=server.

2007-08-01 17:04 633 查看
hi i am making a web site in VS 05 and when i add a menu i get this message when i rum the site

Server Error in '/WNC' Application.

Control 'ctl00_Menu1' of type 'Menu' must be placed inside a form tag with runat=server.

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: Control 'ctl00_Menu1' of type 'Menu' must be placed inside a form tag with runat=server.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): Control 'ctl00_Menu1' of type 'Menu' must be placed inside a form tag with runat=server.]System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +214System.Web.UI.WebControls.Menu.Render(HtmlTextWriter writer) +37System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +280System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +21System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +29System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +280System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +21System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +29System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +280System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +21System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +29System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +280System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +21System.Web.UI.Control.Render(HtmlTextWriter writer) +7System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +280System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +21System.Web.UI.Page.Render(HtmlTextWriter writer) +27System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +280System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7425
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42This is the code i am useing to impliment the menu<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" Height="83px" Width="203px"></asp:Menu>
  Khamul  Death by Escape Key
 
  Sat, Mar 4 2006 6:11 PM
You will need to place the control inside a <form id="form1" runat="server"> </form>tag. 
  mastermine  ME + Vista + 360 = Magic
 
  Sat, Mar 4 2006 7:09 PM
Thanks
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐