gpt4 book ai didi

asp.net - 如何将 HTML 页面转换为 .ASPX 页面并向其添加/删除控件而不更改页面布局

转载 作者:行者123 更新时间:2023-12-03 00:31:29 25 4
gpt4 key购买 nike

您好,我是 ASP.NET 新手

我有一个从另一个程序设计的 html 页面,我想使用 Visual Web Developer 将 html 转换为 asp.net aspx Web 表单。

我已经正常打开页面,但很难移动或替换布局页面中的控件,例如当我移动按钮时,页面设计会崩溃。如何在 Visual web Developer 2010 上将按钮或文本框插入到 aspx/html 中而不更改页面布局?

最佳答案

要将 html 页面转换为 aspx 页面,

1. Create a new web form in visual web developer.
2. Copy the content from body of the html file , paste it in body of the aspx page.
3. Similarly copy the script, meta tags from head section of html , paste it in head section of aspx page.
4.if any external style sheet,Images included with html file, add them appropriately in a folder of your asp.net application.
5.Now try to run the page and check if everything appears well, if not appearing well check the stylesheet and make some small changes.
6.Check at the top of the page asp.net , <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> it is necessary.

练习将使您在 CSS、样式和 HTML 方面变得完美。

--------------------一切都应该很好--------------

如果您在代码后面没有找到任何控件,请在标记中添加 [runat="server"] 属性。是一个html控件,是一个服务器控件。

<小时/>

关于asp.net - 如何将 HTML 页面转换为 .ASPX 页面并向其添加/删除控件而不更改页面布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14450688/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com