原本打算:我的首页上有一个需要runat="server"的form,这个form用于显示detailsview。
<form id="form1" runat="server">
<div>
<asp:DetailsView ID="MessageView" runat="server">
</asp:DetailsView> </div>
</form> 首页引用MasterPageFile为所用页面的Layout,MasterPageFile文件里面有
<form runat="server">
<asp:ScriptManager runat="server">
<Scripts>
<%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=272931&clcid=0x409 --%>
<%--Framework Scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="common.js" Assembly="System.Web" Path="~/Scripts/WebForms/common.js" />
<asp:ScriptReference Name="swipe.js" Assembly="System.Web" Path="~/Scripts/WebForms/swipe.js" />
<asp:ScriptReference Name="WebFormsBundle" />
<%--Site Scripts--%> </Scripts>
</asp:ScriptManager>如果是这样调试的话,直接报错说不能显示两个带runat="server"的form,请问有什么方法解决吗?谢谢谢。
<form id="form1" runat="server">
<div>
<asp:DetailsView ID="MessageView" runat="server">
</asp:DetailsView> </div>
</form> 首页引用MasterPageFile为所用页面的Layout,MasterPageFile文件里面有
<form runat="server">
<asp:ScriptManager runat="server">
<Scripts>
<%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=272931&clcid=0x409 --%>
<%--Framework Scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="common.js" Assembly="System.Web" Path="~/Scripts/WebForms/common.js" />
<asp:ScriptReference Name="swipe.js" Assembly="System.Web" Path="~/Scripts/WebForms/swipe.js" />
<asp:ScriptReference Name="WebFormsBundle" />
<%--Site Scripts--%> </Scripts>
</asp:ScriptManager>如果是这样调试的话,直接报错说不能显示两个带runat="server"的form,请问有什么方法解决吗?谢谢谢。
解决方案 »
- 【收集代码】收集服务器安全配置操作以及写代码时的安全注意,最好再写上攻击方式和解决办法
- dwz 主从表结构 序号问题
- 在使用IbatisNet是出现“Could not load type from string value 'getM_2Report-results'”
- 多文件上传问题 麻烦各位了 请指教下 不提交数据库直接报错
- 怎么设置DataGrid控件在点击“编辑”后出现的文本框的CSS样式??
- 跪求网站COOKIES整套解决方案,包括用户登陆页面的程序,设置用户Cookies,退出清空Cookies!!高分,不够再加!!
- 请问如何从WORD文档中一行一行的读取数据啊????
- 这是我的第一个asp.net文件,但不知道哪儿错哪儿?
- 关于更改临时文件存放路径的问题
- 我在VS.net中的.vb文件中如何调用Server.MapPath??
- 请问如何将Dataset容器里的多行内容读取出来?
- .net反编译后发现代码混淆了,求助
MasterPageFile 母板页吗?如果母板页有了的话内容页就不需要有了啊...
如果你是想提交不同地址的话 那你会失望的
form加runat后只会提交到本页的
你可以有多个form, 但是之能有一个 runat="server" form.
解决办法:去掉第一个,让masterpage 那个起作用好了
<div>
<asp:DetailsView ID="MessageView" runat="server">
</asp:DetailsView>
</div>