PC Review


Reply
Thread Tools Rate Thread

Controls v HTML

 
 
ThatsIT.net.au
Guest
Posts: n/a
 
      11th Oct 2007
I come from a classic asp background, but have started using ASP.NET about
12 months ago, but I'm still not sure about the pros and cons of using
controls v HTML spat out from code as you would in classic asp. I have also
been using System.Web.UI.ICallbackEventHandler to send data to the server
and back without using controls.

What I want to know is the pros and cons of each. To me you never have quite
the freedom using a control as you do manipulating html and spitting it out,
but it can be quicker using a control for more simple jobs.

what are the performance issues?

What have other classic asp users found to be best when using asp.net?


 
Reply With Quote
 
 
 
 
darrel
Guest
Posts: n/a
 
      11th Oct 2007
>I come from a classic asp background, but have started using ASP.NET about
>12 months ago, but I'm still not sure about the pros and cons of using
>controls v HTML spat out from code as you would in classic asp. I have also
>been using System.Web.UI.ICallbackEventHandler to send data to the server
>and back without using controls.


The advantages of controls like DataGrid and the like is that it's simply
faster/easier to get data from your back end onto your front end.

The advantages of controls like repeaters and the like is that you can get
that 'ideal' separation of presentation on the front (.aspx) end with logic
on the back end (.vb/cs files)

The disadvantages of the built in web controls...ESPECIALLY in 1.1, was that
the HTML, for the most part, sucked. It wasn't very semantic and often
invalid.

So, I got in the habit of using a lot of stringwriters ala classic ASP.

I'm now trying ot break myself of that habit as I move into 2.0 ;o)

> What I want to know is the pros and cons of each. To me you never have
> quite the freedom using a control as you do manipulating html and spitting
> it out, but it can be quicker using a control for more simple jobs.


that's pretty much it.

Even the 2.0 controls are somewhat limited. Ie, a datagrid is really easy to
set up to allow the viewing and editing of content from one table. But once
you start getting into manipulating data across tables via joins and the
like, then the datagrid becomes rather complex to deal with.

> What have other classic asp users found to be best when using asp.net?


IMHO, if you are willing to embrace the entire concept of OOP development,
then do it, and go with ASP.net. If you prefer the ASP 'lifestyle' then
consider migrating to PHP, as that is closer in methedology.

-Darrel


 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      11th Oct 2007
I doubt there are any real performance issues, everything gets spit out to
the response output stream anyway, whether you do it "manually" or let a
control do it by responding to its Render method from the Page class.

I've seen developers coming from a classic ASP (and so did I) environment
who just refuse to accept progress and do everything the "old way". I would
suggest you change your mindset to the concept of ASP.NET controls - and even
consider writing some of your own CustomControls along the way.

If you run into a situation where you just absolutely cannot figure out how
to make the ASP.NET Controls on the Toolbox do what you need, you can always
fall back to building strings of HTML with a StringBuilder and attaching the
output HTML to a placeholder or HtmlGeneric("div") control's InnerHTML
property.

Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com



"ThatsIT.net.au" wrote:

> I come from a classic asp background, but have started using ASP.NET about
> 12 months ago, but I'm still not sure about the pros and cons of using
> controls v HTML spat out from code as you would in classic asp. I have also
> been using System.Web.UI.ICallbackEventHandler to send data to the server
> and back without using controls.
>
> What I want to know is the pros and cons of each. To me you never have quite
> the freedom using a control as you do manipulating html and spitting it out,
> but it can be quicker using a control for more simple jobs.
>
> what are the performance issues?
>
> What have other classic asp users found to be best when using asp.net?
>
>

 
Reply With Quote
 
ThatsIT.net.au
Guest
Posts: n/a
 
      12th Oct 2007

"darrel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> >I come from a classic asp background, but have started using ASP.NET
> >about 12 months ago, but I'm still not sure about the pros and cons of
> >using controls v HTML spat out from code as you would in classic asp. I
> >have also been using System.Web.UI.ICallbackEventHandler to send data to
> >the server and back without using controls.

>
> The advantages of controls like DataGrid and the like is that it's simply
> faster/easier to get data from your back end onto your front end.
>
> The advantages of controls like repeaters and the like is that you can get
> that 'ideal' separation of presentation on the front (.aspx) end with
> logic on the back end (.vb/cs files)
>
> The disadvantages of the built in web controls...ESPECIALLY in 1.1, was
> that the HTML, for the most part, sucked. It wasn't very semantic and
> often invalid.
>
> So, I got in the habit of using a lot of stringwriters ala classic ASP.
>
> I'm now trying ot break myself of that habit as I move into 2.0 ;o)
>


Same here. But sometimes it just easier to spit out html from script than
fiddle with a control for hours and find that you can't get it to do what
you want properly.


>> What I want to know is the pros and cons of each. To me you never have
>> quite the freedom using a control as you do manipulating html and
>> spitting it out, but it can be quicker using a control for more simple
>> jobs.

>
> that's pretty much it.
>
> Even the 2.0 controls are somewhat limited. Ie, a datagrid is really easy
> to set up to allow the viewing and editing of content from one table. But
> once you start getting into manipulating data across tables via joins and
> the like, then the datagrid becomes rather complex to deal with.
>
>> What have other classic asp users found to be best when using asp.net?

>
> IMHO, if you are willing to embrace the entire concept of OOP development,
> then do it, and go with ASP.net. If you prefer the ASP 'lifestyle' then
> consider migrating to PHP, as that is closer in methedology.
>



I have tried php, I found it messy and cumbersome.

There is a lot I like about ASP.NET. The main problem seems to be too many
choices and wasting time following the wrong choice for a few hours then
changing your approach, I guess this will improve with experience


> -Darrel
>


 
Reply With Quote
 
ThatsIT.net.au
Guest
Posts: n/a
 
      12th Oct 2007
Yes I am trying to use controls where I can , but spit out html when it
needs that bit extra.

I have also been using System.Web.UI.ICallbackEventHandler to send data back
and forward to the server manually, this works very well, there no reload at
all, even Ajax gives a flicker here and there but using
System.Web.UI.ICallbackEventHandler there is absolutely no reload, but I
have found bugs such as you can not use the "i" as a variable in your loops,
it also dose not like functions that return Boolean values. I don't seem to
find much documentation on this approach or have I found anyone else that
uses it, I wonder if there is not any other bugs or problems with it.



"Peter Bromberg [C# MVP]" <(E-Mail Removed)> wrote
in message news:1C8A2F6A-DB37-4DFB-9269-(E-Mail Removed)...
>I doubt there are any real performance issues, everything gets spit out to
> the response output stream anyway, whether you do it "manually" or let a
> control do it by responding to its Render method from the Page class.
>
> I've seen developers coming from a classic ASP (and so did I) environment
> who just refuse to accept progress and do everything the "old way". I
> would
> suggest you change your mindset to the concept of ASP.NET controls - and
> even
> consider writing some of your own CustomControls along the way.
>
> If you run into a situation where you just absolutely cannot figure out
> how
> to make the ASP.NET Controls on the Toolbox do what you need, you can
> always
> fall back to building strings of HTML with a StringBuilder and attaching
> the
> output HTML to a placeholder or HtmlGeneric("div") control's InnerHTML
> property.
>
> Peter
> --
> Recursion: see Recursion
> site: http://www.eggheadcafe.com
> unBlog: http://petesbloggerama.blogspot.com
> BlogMetaFinder: http://www.blogmetafinder.com
>
>
>
> "ThatsIT.net.au" wrote:
>
>> I come from a classic asp background, but have started using ASP.NET
>> about
>> 12 months ago, but I'm still not sure about the pros and cons of using
>> controls v HTML spat out from code as you would in classic asp. I have
>> also
>> been using System.Web.UI.ICallbackEventHandler to send data to the server
>> and back without using controls.
>>
>> What I want to know is the pros and cons of each. To me you never have
>> quite
>> the freedom using a control as you do manipulating html and spitting it
>> out,
>> but it can be quicker using a control for more simple jobs.
>>
>> what are the performance issues?
>>
>> What have other classic asp users found to be best when using asp.net?
>>
>>


 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      12th Oct 2007
The answer really depends on what your career is. If you are a professional
developer, and plan to remain one, embrace and master object-oriented
programming, learn how to employ the power of OOP and good object-oriented
design and architecture patterns and practices, and expect to take a good
long time doing so. In the long run, you'll be much better off, write
software that is powerful, secure, easy to maintain and extend, and get much
more done in much less time.

If on the other hand, you are a hobbyist, it is entirely up to you whether
you want to go to all that trouble.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"ThatsIT.net.au" <me@thatsit> wrote in message
news:6A1D6B5A-0AD1-4190-8955-(E-Mail Removed)...
>I come from a classic asp background, but have started using ASP.NET about
>12 months ago, but I'm still not sure about the pros and cons of using
>controls v HTML spat out from code as you would in classic asp. I have also
>been using System.Web.UI.ICallbackEventHandler to send data to the server
>and back without using controls.
>
> What I want to know is the pros and cons of each. To me you never have
> quite the freedom using a control as you do manipulating html and spitting
> it out, but it can be quicker using a control for more simple jobs.
>
> what are the performance issues?
>
> What have other classic asp users found to be best when using asp.net?
>
>



 
Reply With Quote
 
Phil H
Guest
Posts: n/a
 
      12th Oct 2007
On 12 Oct, 17:33, "Kevin Spencer" <unclechut...@nothinks.com> wrote:
> The answer really depends on what your career is. If you are a professional
> developer, and plan to remain one, embrace and master object-oriented
> programming, learn how to employ the power of OOP and good object-oriented
> design and architecture patterns and practices, and expect to take a good
> long time doing so. In the long run, you'll be much better off, write
> software that is powerful, secure, easy to maintain and extend, and get much
> more done in much less time.
>
> If on the other hand, you are a hobbyist, it is entirely up to you whether
> you want to go to all that trouble.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
>
> DSI PrintManager, Miradyne Component Libraries:http://www.miradyne.net
>
> "ThatsIT.net.au" <me@thatsit> wrote in message
>
> news:6A1D6B5A-0AD1-4190-8955-(E-Mail Removed)...
>
>
>
> >I come from a classic asp background, but have started using ASP.NET about
> >12 months ago, but I'm still not sure about the pros and cons of using
> >controls v HTML spat out from code as you would in classic asp. I have also
> >been using System.Web.UI.ICallbackEventHandler to send data to the server
> >and back without using controls.

>
> > What I want to know is the pros and cons of each. To me you never have
> > quite the freedom using a control as you do manipulating html and spitting
> > it out, but it can be quicker using a control for more simple jobs.

>
> > what are the performance issues?

>
> > What have other classic asp users found to be best when using asp.net?- Hide quoted text -

>
> - Show quoted text -


I am inclined to agree with much of what has been said about embracing
ASP.NET I have never used ASP but one thing has stood out for me in
using ASP.NET is that it remains just as important to know HTML
thoroughly. Microsoft did not try to hide HTML from the developer with
ASP.NET rather they introduced a powerful set of tools for server-side
programming that communicates with the client in a W3C compliant
fashion but still supports traditional HTML in the source pages. Web
server controls, such as labels, hyperlinks and images are embedded
inside traditional tags but enable programmatic control of content
where needed. The two technologies complement one another very well.

As for migrating from ASP, even though I lack experience it seems
obvious to me that it is best left behind altogether and not to try
and "adapt" the new technology to the old, which will only obscure the
advantages of the newer methodologies.

 
Reply With Quote
 
ThatsIT.net.au
Guest
Posts: n/a
 
      13th Oct 2007
OOP is not the same as using controls.

I am a big believer in OOP. But I'm not sure that using controls is superior
to spitting out html. My query is not ASP v ASP.NET it is Controls v
spitting out html

"Phil H" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 12 Oct, 17:33, "Kevin Spencer" <unclechut...@nothinks.com> wrote:
>> The answer really depends on what your career is. If you are a
>> professional
>> developer, and plan to remain one, embrace and master object-oriented
>> programming, learn how to employ the power of OOP and good
>> object-oriented
>> design and architecture patterns and practices, and expect to take a good
>> long time doing so. In the long run, you'll be much better off, write
>> software that is powerful, secure, easy to maintain and extend, and get
>> much
>> more done in much less time.
>>
>> If on the other hand, you are a hobbyist, it is entirely up to you
>> whether
>> you want to go to all that trouble.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>>
>> DSI PrintManager, Miradyne Component Libraries:http://www.miradyne.net
>>
>> "ThatsIT.net.au" <me@thatsit> wrote in message
>>
>> news:6A1D6B5A-0AD1-4190-8955-(E-Mail Removed)...
>>
>>
>>
>> >I come from a classic asp background, but have started using ASP.NET
>> >about
>> >12 months ago, but I'm still not sure about the pros and cons of using
>> >controls v HTML spat out from code as you would in classic asp. I have
>> >also
>> >been using System.Web.UI.ICallbackEventHandler to send data to the
>> >server
>> >and back without using controls.

>>
>> > What I want to know is the pros and cons of each. To me you never have
>> > quite the freedom using a control as you do manipulating html and
>> > spitting
>> > it out, but it can be quicker using a control for more simple jobs.

>>
>> > what are the performance issues?

>>
>> > What have other classic asp users found to be best when using asp.net?-
>> > Hide quoted text -

>>
>> - Show quoted text -

>
> I am inclined to agree with much of what has been said about embracing
> ASP.NET I have never used ASP but one thing has stood out for me in
> using ASP.NET is that it remains just as important to know HTML
> thoroughly. Microsoft did not try to hide HTML from the developer with
> ASP.NET rather they introduced a powerful set of tools for server-side
> programming that communicates with the client in a W3C compliant
> fashion but still supports traditional HTML in the source pages. Web
> server controls, such as labels, hyperlinks and images are embedded
> inside traditional tags but enable programmatic control of content
> where needed. The two technologies complement one another very well.
>
> As for migrating from ASP, even though I lack experience it seems
> obvious to me that it is best left behind altogether and not to try
> and "adapt" the new technology to the old, which will only obscure the
> advantages of the newer methodologies.
>


 
Reply With Quote
 
Mike Placentra II
Guest
Posts: n/a
 
      14th Oct 2007
-Easier to reuse
Your next best option to reuse code that spits out dynamic HTML
would be to create a subscript. If you were to create a subscript that
does what the GridView control does, it would have more parameters
than would be worth dealing with.

-OOP benefits
What Kevin Spencer means is that you work with controls
programmatically in an OOP fashion. A control gives you events,
methods, and properties for interacting with it to make your code more
organized. A control is really an object, so using a control is using
OOP.

-IDE integration
You can work with controls graphically at design time, whether
they are user controls or server controls (assuming the server control
code has appropriate attributes and a ControlDesigner).

One who works primarily with ASP.net may take controls for granted,
but programmers of more procedural languages who understand ASP.net
controls sometimes envy you.

http://php.net/dotnet

(that's for the PHP programmers who haven't discovered the value of
those RAD frameworks for PHP)

-Michael Placentra II


On Oct 13, 11:17 am, "ThatsIT.net.au" <me@thatsit> wrote:
> OOP is not the same as using controls.
>
> I am a big believer in OOP. But I'm not sure that using controls is superior
> to spitting out html. My query is not ASP v ASP.NET it is Controls v
> spitting out html


 
Reply With Quote
 
ThatsIT.net.au
Guest
Posts: n/a
 
      14th Oct 2007

"Mike Placentra II" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> -Easier to reuse
> Your next best option to reuse code that spits out dynamic HTML
> would be to create a subscript. If you were to create a subscript that
> does what the GridView control does, it would have more parameters
> than would be worth dealing with.



yes I agree that using controls in some circumstances is a good thing, but
in many more complex cases it seems easier to use html. Using the
System.Web.UI.ICallbackEventHandler you can talk to the server from client
script and any html element can not do as any asp.net control.


>
> -OOP benefits
> What Kevin Spencer means is that you work with controls
> programmatically in an OOP fashion. A control gives you events,
> methods, and properties for interacting with it to make your code more
> organized. A control is really an object, so using a control is using
> OOP.



for that matter a html elements is a object,
What my point was, was that not using asp.net controls is not to say that
you are not using OOP. the making of classes and creating instances of them
is OOP.


>
> -IDE integration
> You can work with controls graphically at design time, whether
> they are user controls or server controls (assuming the server control
> code has appropriate attributes and a ControlDesigner).
>
> One who works primarily with ASP.net may take controls for granted,
> but programmers of more procedural languages who understand ASP.net
> controls sometimes envy you.
>
> http://php.net/dotnet
>
> (that's for the PHP programmers who haven't discovered the value of
> those RAD frameworks for PHP)
>
> -Michael Placentra II



As for controls I think as I have stated above, they are good for many
occasions but can not be manipulated to the extent as you can with spitting
out html


One thing I would like to know is more about the pros and cons of using
System.Web.UI.ICallbackEventHandler to manually talk to the server from
JavaScript


>
>
> On Oct 13, 11:17 am, "ThatsIT.net.au" <me@thatsit> wrote:
>> OOP is not the same as using controls.
>>
>> I am a big believer in OOP. But I'm not sure that using controls is
>> superior
>> to spitting out html. My query is not ASP v ASP.NET it is Controls v
>> spitting out html

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stardard controls vs HTML controls Sems Microsoft ASP .NET 1 29th Sep 2007 06:55 AM
mixing HTML controls with code behind controls Norm via DotNetMonster.com Microsoft ASP .NET 3 10th May 2005 03:39 PM
What's the difference between HTML controls and the basic web controls? Alan Silver Microsoft ASP .NET 8 24th Jan 2005 06:39 PM
ASP.net Form controls vs HTML controls =?Utf-8?B?a2Vycnlh?= Microsoft Frontpage 3 1st Dec 2004 10:57 PM
difference between HTML controls, HTML server controls , ASP.Net controls? Hari Microsoft Dot NET 1 3rd Jan 2004 11:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:08 AM.