How to convert an HTML page to .ASPX page and add/Remove Controls to it without changing the layout of the page
Asked Answered
S

1

6

Hello I'm a newbie for ASP.NET

I have a designed html page from another program, I want to convert the html into a asp.net aspx web form using visual web developer.

I have opened the page normally but it's difficult to move or replace controls in layout page, for example when I move a button, the design of page collapses. How I can insert button or textbox into a aspx/html on Visual web Developer 2010 without changing the layout of the page?

Sentience answered 22/1, 2013 at 2:38 Comment(5)
Do you have any knowledge of HTML? It may sound weird but Visual Studio is not intended to be used like the old Front Page which was made for WYSIWYG development.Bothnia
Yes I have knowldge base of HTML So there a solution for this?Sentience
do you want to convert a html page to .aspx page? or you want to insert textbox/button into a page that's already designed? -- your second line of question is difficult to understand ..Wilek
If you want to edit your design page don't do it in the design view. Do it in the markup , if you want to remove/add a button , check the code and place it appropriately in the table column or a div..by dragging and dropping in the design page will spoil it completely.Wilek
@codebrain Thank you for your answer, yeah! I want that, I have tried convert to aspx page because i want behind code, so indeed is normaly. but when I try to insert textbox/button and other from toolbox then moving that is all the layout design my designed page is changed,Sentience
W
6

To convert an html page into aspx page,

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.

Practice will give you perfection in css , styling and HTML.

-------------------All should be well--------------

If you don't find any controls in code behind , add [runat="server"] attribute in markup. and is an html control and is server control.


Wilek answered 22/1, 2013 at 6:27 Comment(2)
OK Codebrain, thanks very much for your solution, I have tried all your tips, and almost succeded. on visual web developer the header layout menu designed page is changed but on browser it's normally no layout were changed for position. My Questions why that be happen? ok its not important. The most important questions, Can I lock header menu or component on Visual Web Developer so I can editable body section?Sentience
If you downloaded some static html template, you need to check the designs and make modifications for your requirement. Try working on HTML tables and div tags. It will give you good experience in designing. use CSS stylesheets. You may made mistakes in div or table tags and assigning height and width..[If you answer was helpful please mark it as answer ]. ThanksWilek

© 2022 - 2024 — McMap. All rights reserved.