How to get rid of the quot;defaultquot; form-element from a .aspx-page?(如何摆脱“默认来自 .aspx 页面的表单元素?)
问题描述
作为 Web 标准极客,我不喜欢围绕我的整个网页的默认 <form runat="server">
.我已经看到许多基于 ASP.NET 的网页没有这些,所以看起来它可以在不带走任何功能的情况下被删除.怎么样?
As that web-standards geek I am, I dislike the default <form runat="server">
that surrounds my entire webpages. I've seen many ASP.NET based webpages that don't have these, so it seems like it can be removed without taking away any functionality. How?
推荐答案
如果你想使用控件的东西,就必须有一个 .否则回发是不可能的,viewstate 和 .NET 依赖的其他东西也是如此.
There will have to be a <form runat="server">
if you wish to use controls 'n stuff. Otherwise postbacks are impossible, as is viewstate and the rest of the stuff that .NET depends upon.
你确定你看到了你认为你看到的东西?也许这些页面只包含静态内容?或者它们可能是用户控件?或者另一种常见的可能性 - 也许是母版页具有 <form runat="server">
?
Are you sure you've seen what you've thought you've seen? Perhaps these pages only contained static content? Or perhaps they were user-controls? Or yet another common possibility - perhaps it was the Master Page that had the <form runat="server">
?
这篇关于如何摆脱“默认"来自 .aspx 页面的表单元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何摆脱“默认"来自 .aspx 页面的表单元素


基础教程推荐
- 将 XML 转换为通用列表 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- SSE 浮点算术是否可重现? 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01