Wednesday, March 21, 2012

HTML 2 ASP.NET ?

hi,
i have theese static html pages
what is the best way to replace the content w/ .NET dynamic data w/o
loosing all the formating?
I have VS.NET, but will prefer to write the aspx code w/o designer.
Is there some straight way to replace say every HTML form w/ an
ASP one?

TIA"Bruce" <no@.spam.com> wrote in message
news:%23N4JZUooFHA.2904@.tk2msftngp13.phx.gbl...

> i have theese static html pages
> what is the best way to replace the content w/ .NET dynamic data w/o
> loosing all the formating?
> I have VS.NET, but will prefer to write the aspx code w/o designer.
> Is there some straight way to replace say every HTML form w/ an
> ASP one?

Are you wanting to replace them because you need to turn their static
content into dynamic content? If not, then just leave them the way they
are...
yeap, i need dynamic data from a database

"Mark Rae" <mark@.mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:O0s$pXooFHA.2080@.TK2MSFTNGP14.phx.gbl...
> "Bruce" <no@.spam.com> wrote in message
> news:%23N4JZUooFHA.2904@.tk2msftngp13.phx.gbl...
>> i have theese static html pages
>> what is the best way to replace the content w/ .NET dynamic data w/o
>> loosing all the formating?
>> I have VS.NET, but will prefer to write the aspx code w/o designer.
>> Is there some straight way to replace say every HTML form w/ an
>> ASP one?
> Are you wanting to replace them because you need to turn their static
> content into dynamic content? If not, then just leave them the way they
> are...
I'm not sure I clearly understand what you want, but I'll give this a
stab. You are talking about HTML forms into ASP forms and I don't think
this is directly doable (I could be wrong). The reason being is ASP.NET
wouldn't be able to address the Control heirarchy and persist ViewState
for you. It would simply render out the "html" with no server side
abilities.

If you are simply talking about text content and not HTML form elements,
then this is a simple matter of cut & paste into a SQL table with a
little development of a control to grab the data.

Clint Hill
H3O Software
http://www.h3osoftware.com

Bruce wrote:
> yeap, i need dynamic data from a database
> "Mark Rae" <mark@.mark-N-O-S-P-A-M-rae.co.uk> wrote in message
> news:O0s$pXooFHA.2080@.TK2MSFTNGP14.phx.gbl...
>>"Bruce" <no@.spam.com> wrote in message
>>news:%23N4JZUooFHA.2904@.tk2msftngp13.phx.gbl...
>>
>>
>>>i have theese static html pages
>>>what is the best way to replace the content w/ .NET dynamic data w/o
>>>loosing all the formating?
>>>I have VS.NET, but will prefer to write the aspx code w/o designer.
>>>Is there some straight way to replace say every HTML form w/ an
>>>ASP one?
>>
>>Are you wanting to replace them because you need to turn their static
>>content into dynamic content? If not, then just leave them the way they
>>are...
>>
>
"Bruce" <no@.spam.com> wrote in message
news:uf9EagooFHA.1468@.TK2MSFTNGP12.phx.gbl...

> yeap, i need dynamic data from a database

In which case, you'll pretty much need to create the ASPX pages from
scratch. But, any formatting that's possible in raw HTML is perfectly
possible in ASP.NET.
> i have theese static html pages
> what is the best way to replace the content w/ .NET dynamic data w/o
> loosing all the formating?

Write an asp.net application that pulls the data out of the database and
formats the content the same was as your current HTML page is formatted.

There's no 'automated' way to do what you are asking.

-Darrel
The problem is i am not any good at HTML, the pages are already written by a
profecinal
designer, updates are now done manually :( and i heard VS.NET designer
produces very messy markup.
Do u know of some table listing ASP.NET server componets similar to the
different HTML
interface elements or some conversion software?

"Bruce" <no@.spam.com> wrote in message
news:uf9EagooFHA.1468@.TK2MSFTNGP12.phx.gbl...
> yeap, i need dynamic data from a database
> "Mark Rae" <mark@.mark-N-O-S-P-A-M-rae.co.uk> wrote in message
> news:O0s$pXooFHA.2080@.TK2MSFTNGP14.phx.gbl...
>> "Bruce" <no@.spam.com> wrote in message
>> news:%23N4JZUooFHA.2904@.tk2msftngp13.phx.gbl...
>>
>>> i have theese static html pages
>>> what is the best way to replace the content w/ .NET dynamic data w/o
>>> loosing all the formating?
>>> I have VS.NET, but will prefer to write the aspx code w/o designer.
>>> Is there some straight way to replace say every HTML form w/ an
>>> ASP one?
>>
>> Are you wanting to replace them because you need to turn their static
>> content into dynamic content? If not, then just leave them the way they
>> are...
>>
> The problem is i am not any good at HTML, the pages are already written by
a
> profecinal
> designer, updates are now done manually :( and i heard VS.NET designer
> produces very messy markup.
> Do u know of some table listing ASP.NET server componets similar to the
> different HTML
> interface elements or some conversion software?

ASP.net's default controls are pretty bad when it comes to producing clean,
semantic, standards compliant markup.

Plus, you still have the issue of formatting the specific content on your
page.

You really need to do this with some custom programing. There really isn't
any way around this.

-Darrel
"Bruce" <no@.spam.com> wrote in
news:#TT$TrpoFHA.1872@.TK2MSFTNGP10.phx.gbl:

> The problem is i am not any good at HTML, the pages are already
> written by a profecinal
> designer, updates are now done manually :( and i heard VS.NET designer
> produces very messy markup.
> Do u know of some table listing ASP.NET server componets similar to
> the different HTML
> interface elements or some conversion software?

No such software. Use the HTML as a template and add dynamic controls to
the page - replacing the static text. That is probably your easiest
solution.

--
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
:(
u could at least say "wait for ASP.NET 3.0" ^_^
ok, say i have an HTML label, how do i write an ASP label
that rendres w/ the same size, color and triggers the same
JavaScript functions?

"Bruce" <no@.spam.com> wrote in message
news:%23TT$TrpoFHA.1872@.TK2MSFTNGP10.phx.gbl...
> The problem is i am not any good at HTML, the pages are already written by
> a profecinal
> designer, updates are now done manually :( and i heard VS.NET designer
> produces very messy markup.
> Do u know of some table listing ASP.NET server componets similar to the
> different HTML
> interface elements or some conversion software?
> "Bruce" <no@.spam.com> wrote in message
> news:uf9EagooFHA.1468@.TK2MSFTNGP12.phx.gbl...
>> yeap, i need dynamic data from a database
>>
>> "Mark Rae" <mark@.mark-N-O-S-P-A-M-rae.co.uk> wrote in message
>> news:O0s$pXooFHA.2080@.TK2MSFTNGP14.phx.gbl...
>>> "Bruce" <no@.spam.com> wrote in message
>>> news:%23N4JZUooFHA.2904@.tk2msftngp13.phx.gbl...
>>>
>>>> i have theese static html pages
>>>> what is the best way to replace the content w/ .NET dynamic data w/o
>>>> loosing all the formating?
>>>> I have VS.NET, but will prefer to write the aspx code w/o designer.
>>>> Is there some straight way to replace say every HTML form w/ an
>>>> ASP one?
>>>
>>> Are you wanting to replace them because you need to turn their static
>>> content into dynamic content? If not, then just leave them the way they
>>> are...
>>>
>>
>>
If you're looking for some kind of uber-basic content management solution --
say, to allow non-technical users to update defined parts of a webpage --
you could look at some off-the-shelf product like Macromedia Contribute. It
would be easier than setting up a code-based solution, which is what you're
asking here.

If you don't know how to code, there isn't a quick and painless way to do
what you wanna do.

-KF

"Bruce" <no@.spam.com> wrote in message
news:OIf2EPsoFHA.3656@.TK2MSFTNGP09.phx.gbl...
> :(
> u could at least say "wait for ASP.NET 3.0" ^_^
> ok, say i have an HTML label, how do i write an ASP label
> that rendres w/ the same size, color and triggers the same
> JavaScript functions?
> "Bruce" <no@.spam.com> wrote in message
> news:%23TT$TrpoFHA.1872@.TK2MSFTNGP10.phx.gbl...
>> The problem is i am not any good at HTML, the pages are already written
>> by a profecinal
>> designer, updates are now done manually :( and i heard VS.NET designer
>> produces very messy markup.
>> Do u know of some table listing ASP.NET server componets similar to the
>> different HTML
>> interface elements or some conversion software?
>>
>> "Bruce" <no@.spam.com> wrote in message
>> news:uf9EagooFHA.1468@.TK2MSFTNGP12.phx.gbl...
>>> yeap, i need dynamic data from a database
>>>
>>> "Mark Rae" <mark@.mark-N-O-S-P-A-M-rae.co.uk> wrote in message
>>> news:O0s$pXooFHA.2080@.TK2MSFTNGP14.phx.gbl...
>>>> "Bruce" <no@.spam.com> wrote in message
>>>> news:%23N4JZUooFHA.2904@.tk2msftngp13.phx.gbl...
>>>>
>>>>> i have theese static html pages
>>>>> what is the best way to replace the content w/ .NET dynamic data w/o
>>>>> loosing all the formating?
>>>>> I have VS.NET, but will prefer to write the aspx code w/o designer.
>>>>> Is there some straight way to replace say every HTML form w/ an
>>>>> ASP one?
>>>>
>>>> Are you wanting to replace them because you need to turn their static
>>>> content into dynamic content? If not, then just leave them the way they
>>>> are...
>>>>
>>>
>>>
>>
>>
> Do u know of some table listing ASP.NET server componets similar to the
> different HTML interface elements ...?

Converting an html page to an aspx one is not so complicated.

1. Start a new web application project.
2. Add a new web form for every page.
3. For every page copy/paste the html content to the new web form in Html
view.
4. Add runat="server" attribute to those of your existing html controls you
want to make dynamic. You will also need to set the id attribute.
5. For every page switch to the Design view, wait for a few seconds and
switch back to the Html view. Press ctrlZ twice to undo the formatting mess
introduced by the Visual Studio.
6. View code-behind. You will find that the Visual Studio created a server
control for every html control with runat="server".
7. Start programming your pages.

That's about it.

Eliyahu
> u could at least say "wait for ASP.NET 3.0" ^_^
> ok, say i have an HTML label, how do i write an ASP label
> that rendres w/ the same size, color and triggers the same
> JavaScript functions?

Why use an ASP label?

Just use the HTML label and put runat="server" in it. Then you can still put
your inline javascript and CSS if you wish.

-Darrel
tnx a lot

"Eliyahu Goldin" <removemeegoldin@.monarchmed.com> wrote in message
news:O7$2NnwoFHA.3304@.tk2msftngp13.phx.gbl...
>> Do u know of some table listing ASP.NET server componets similar to the
>> different HTML interface elements ...?
> Converting an html page to an aspx one is not so complicated.
> 1. Start a new web application project.
> 2. Add a new web form for every page.
> 3. For every page copy/paste the html content to the new web form in Html
> view.
> 4. Add runat="server" attribute to those of your existing html controls
> you
> want to make dynamic. You will also need to set the id attribute.
> 5. For every page switch to the Design view, wait for a few seconds and
> switch back to the Html view. Press ctrlZ twice to undo the formatting
> mess
> introduced by the Visual Studio.
> 6. View code-behind. You will find that the Visual Studio created a server
> control for every html control with runat="server".
> 7. Start programming your pages.
> That's about it.
> Eliyahu
tnx

"darrel" <notreal@.hotmail.com> wrote in message
news:O4puYO1oFHA.764@.TK2MSFTNGP14.phx.gbl...
>> u could at least say "wait for ASP.NET 3.0" ^_^
>> ok, say i have an HTML label, how do i write an ASP label
>> that rendres w/ the same size, color and triggers the same
>> JavaScript functions?
> Why use an ASP label?
> Just use the HTML label and put runat="server" in it. Then you can still
> put
> your inline javascript and CSS if you wish.
> -Darrel

No comments:

Post a Comment