Converting HTML to ASPX

G

Guest

Is there a function in VS or a utility that will take an HTML file and create
a code-behind ASPX page?

The idea is, I'd like to be able to have someone develop beautiful, fully
functional HTML pages and then pull them in and convert them to ASPX
WebForms, doing a bunch of things like: Convert various standard html tags to
<ASP:...> equivalents, etc., etc.

Any ideas?

Alex
 
J

John Timney \(MVP\)

No there isn't a utility. You have to understand the object model to
determine whether to use a html control or an asp.net control in converting
a page, also, the submission method used, layout, javascript and stylesheets
may not lend themselves easily to code behind or any form of
auto-conversion. Its best done manually, but usually from a basic html
design as your expecting.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 
G

Guest

Well, I was hoping to find some utility that could at least help me based on
rules *I* establish. Really, the only thing I'd love to be able to do is
convert HTML control tags to ASP.NET control tags throughout a page. But I
supposed I can do it with sophisticated search and replace of my own. I'm
just lazy and other people do these things better than I.

Alex
 
J

Jon Paal [MSMD]

There is no built in utility. A custom solution is really your only option..

You might get lucky and stumble across someone else's effort, but even then it might not produce your desired results because
formatting of html isn't truly standardized. Folks generally use their own preference as to how (x)html is presented and organized.
 
S

Steven Cheng[MSFT]

Hi Alex,

I'm afraid so far there is no built-in utiltity that can help directly
convert a HTML file to an aspx/codebehind pair.

BTW, for those simple html input elements or some controls that has Html
server controls mapping to them, you can add a runat="server" attribute so
as to make them become an ASP.NET server control.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Well yes, *exactly*. Even the job os inderting "runat="server" into 50
controls on 85 pages is a nightmare!

See, one of the things that is so promising about ASP.NET 2.0 and later is
the clean ability to separate design/display from code. But in real life, the
way that happens is the one person builds HTML pages (usually first) and
another person "codes" them. Usually afterward. In big companies, the
HTML/design is often outsourced, which means it comes in as ".htm" pages that
you can open, click through, etc. THEN you need to turn them into ASPXs and
do the coding.

Looks like it's time for me to start writing some utility software. Maybe MS
will buy it from me for a billion dollars next year :)

Alex
 
J

John Timney \(MVP\)

What your seeing as an approach is how its done in business, and will be for
some considerable time. What makes it much easier with .net 2.0 is the
ability to make use of master pages so that your designing once, and and
using that presentation layer centrally. Its not an easy task to seperate
presentation from logic once you have them already integrated, but starting
from the concept that presentation is a single entity and centrally managed
and changed makes life very easy when it comes to changing the brand of a
site built on this concept later.


Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top