请教:
      我DRM 里插入一个 一行一列的表格
然后保存为 WebForm1.aspx !     我打开 vs  ,然后再往那个表格里拖入一个 Button1 控件(web Form)得到代码如下:
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table width="90" border="0" id="TABLE1" runat="server">
<tr>
<td width="84" height="38">&nbsp;
<asp:Button id="Button3" runat="server" Text="Button"></asp:Button></td>
</tr>
</table>
</body>
</html>可是我运行时出现这样的错误:
Server Error in '/MyWeb/WebApplication20' Application.
--------------------------------------------------------------------------------Control 'Button3' of type 'Button' 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 'Button3' of type 'Button' 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 'Button3' of type 'Button' must be placed inside a form tag with runat=server.]
   System.Web.UI.Page.VerifyRenderingInServerForm(Control control)
   System.Web.UI.WebControls.Button.AddAttributesToRender(HtmlTextWriter writer)
   System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer)
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   System.Web.UI.HtmlControls.HtmlTableRow.RenderChildren(HtmlTextWriter writer)
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   System.Web.UI.HtmlControls.HtmlTable.RenderChildren(HtmlTextWriter writer)
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   System.Web.UI.Control.Render(HtmlTextWriter writer)
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   System.Web.UI.Page.ProcessRequestMain() 
各位大哥,我应该怎么修改呢?谢谢!

解决方案 »

  1.   

    错误提示很清楚吗,修改为
    !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>无标题文档</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body>
                  <form runat="server">
    <table width="90" border="0" id="TABLE1" runat="server">
    <tr>
    <td width="84" height="38">&nbsp;
    <asp:Button id="Button3" runat="server" Text="Button"></asp:Button></td>
    </tr>
    </table>
                  </form>
    </body>
    </html>
      

  2.   

    放到form里边的,加个form就行了,楼上正解
      

  3.   

    <form runat="server">
      

  4.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>无标题文档</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body>
    <form runat="server" id="form1">
    <table width="90" border="0" id="TABLE1" runat="server">
    <tr>
    <td width="84" height="38">&nbsp;
    <asp:Button id="Button3" runat="server" Text="Button"></asp:Button></td>
    </tr>
    </table>
    </form>
    </body>
    </html>
      

  5.   

    最好是用VS。NET建立好文件后,再到DW里面进行编辑。。
    这样的话,有些比如也面连接类等才不会出现混乱。。
      

  6.   

    谢谢各位大哥!
    因为 我是用抓图软件把别人的网站抓下来,然后放到 Photoshop  里去处理,然后保存为
    Web 页面,然后再用 DRM 打开,然后再保存为 webform1.aspx请教,如果先用 DRM 打开 webform1.aspx ,我怎么把 用photoshop 处理的网页倒入进来呢?
    谢谢!
      

  7.   

    可是在 phtoshop  里面不能直接保存为 aspx  啊?
    各位大哥,是不是啊?
    谢谢!