Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在asp.net中使用现有html布局_Asp.net_Html_Templating - Fatal编程技术网

在asp.net中使用现有html布局

在asp.net中使用现有html布局,asp.net,html,templating,Asp.net,Html,Templating,这是我第一次尝试创建登录页面。我希望能够做的是获取现有的html并将登录控件放在该页面上。我意识到我不能把html和asp控件放在上面。我的问题是如何使用现有的HTML布局作为新的aspx页面的模板?创建一个空的asp.net项目,然后将HTML复制到新页面中,并对其进行修改,以使用您放入其中的控件。1)获取现有页面的源代码(在浏览器中查看->右键单击->查看源->全选->复制) 2) 创建一个新的aspx页面;删除指令后的所有内容 3) 从HTML页面粘贴HTML源代码。 4) 切换到aspx

这是我第一次尝试创建登录页面。我希望能够做的是获取现有的html并将登录控件放在该页面上。我意识到我不能把html和asp控件放在上面。我的问题是如何使用现有的HTML布局作为新的aspx页面的模板?

创建一个空的asp.net项目,然后将HTML复制到新页面中,并对其进行修改,以使用您放入其中的控件。

1)获取现有页面的源代码(在浏览器中查看->右键单击->查看源->全选->复制) 2) 创建一个新的aspx页面;删除指令后的所有内容 3) 从HTML页面粘贴HTML源代码。
4) 切换到aspx页面的“设计”视图,删除您不需要的内容,添加登录控件。

如果您希望在多个页面上持久化布局,但我不确定这是否是您要查找的,那么最好将布局的html存储在母版页中

<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="HeaderContent" runat="server"></asp:ContentPlaceHolder>
</head>
<body>

<div id="wrapper">
  <div id="header">//add in html to setup your header</div>
  <div id="content"><asp:ContnetPlaceHolder ID="Content"></asp:ContentPlaceHolder></div>
  <div id="footer">//add in html to setup the footer</div>
</div>

</body>
</html>

//添加html以设置标题
//添加html以设置页脚

当我添加一个新项目时,你指的是添加一个新的HTML页面吗?Mike,当你单击“新建”时,确保它是一个新的.aspx页面。我没有这个选项,另一种获取新的.aspx页面的方法是选择webformYea,它将创建一个aspx页面,然后你将HTML粘贴到一个新的HTML页面中,新的aspx页面;它将在“添加新”窗口中显示为“Web表单”