473,804 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Controls v HTML

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.I CallbackEventHa ndler 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?
Oct 11 '07 #1
19 1844
>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.I CallbackEventHa ndler 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...ESPE CIALLY 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
Oct 11 '07 #2
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("di v") 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.I CallbackEventHa ndler 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?

Oct 11 '07 #3
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@thatsitwrot e in message
news:6A******** *************** ***********@mic rosoft.com...
>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.I CallbackEventHa ndler 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?


Oct 12 '07 #4
On 12 Oct, 17:33, "Kevin Spencer" <unclechut...@n othinks.comwrot e:
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@thatsitwrot e in message

news:6A******** *************** ***********@mic rosoft.com...
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.I CallbackEventHa ndler 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.

Oct 12 '07 #5
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" <go****@philpha ll.me.ukwrote in message
news:11******** **************@ k35g2000prh.goo glegroups.com.. .
On 12 Oct, 17:33, "Kevin Spencer" <unclechut...@n othinks.comwrot e:
>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.a u" <me@thatsitwrot e in message

news:6A******* *************** ************@mi crosoft.com...
>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.I CallbackEventHa ndler 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.
Oct 13 '07 #6
-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
programmaticall y 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@thatsitwrot e:
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
Oct 14 '07 #7

"Kevin Spencer" <un**********@n othinks.comwrot e in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
"ThatsIT.net.au " <me@thatsitwrot e in message
news:49******** *************** ***********@mic rosoft.com...
>>
<snip>
>I hardly see controls as intimidating, but clumsy, like many attempts at
making things easier, they make themselves less flexible.
<snip>

Whatever your perception of ASP.Net Controls is, it is due to your
unfamiliarity with them, and with your unfamiliarity with the ASP.Net
programming paradigm. When used correctly, ASP.Net Controls do whatever
you want them to do, and very well.
no they don't, I think the tasks you are doing may be very basic.

In some occasions you may not even know the amount of data, number of
fields, data types you will need to display, controls can not handle this
well and present the data formatted correctly on the fly. Some times
condition statements may be needed to decide when to display, make a
calculation or separate the data from one column to 2. Controls can not
handle this well. IOn these cases it is far more productive to use html

Oct 17 '07 #8
"ThatsIT.net.au " <me@thatsitwrot e in message
news:64******** *************** ***********@mic rosoft.com...
<snip>
>Whatever your perception of ASP.Net Controls is, it is due to your
unfamiliarit y with them, and with your unfamiliarity with the ASP.Net
programming paradigm. When used correctly, ASP.Net Controls do whatever
you want them to do, and very well.

no they don't, I think the tasks you are doing may be very basic.
<snip>

I've been doing ASP.Net since the first beta version came out, and I've done
just about everything with ASP.Net that can be done with it, except for
Ajax. I've built a large number of web sites with it, Controls that interact
with SWFs that interact with Web Services that I've built, HttpHandlers for
a variety of purposes, member- and role-based portals that have database
back-ends, database interfaces, Controls that render images and charts,
Controls that use XSLT to create HTML from serialized sets of custom
classes, Controls that render JavaScript, so much stuff that I don't
remember some of it.

Over the years, I've learned to use Controls more, not less, by experience
and research. I have a large personal library of custom Controls that I have
previously built, and employ in projects that come up.

That said, you don't have to believe me. The information I've provided was
for your benefit, not mine. Someday it may be useful to you, if not today.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
Oct 17 '07 #9

"Kevin Spencer" <un**********@n othinks.comwrot e in message
news:eu******** ******@TK2MSFTN GP03.phx.gbl...
"ThatsIT.net.au " <me@thatsitwrot e in message
news:64******** *************** ***********@mic rosoft.com...
<snip>
>>Whatever your perception of ASP.Net Controls is, it is due to your
unfamiliari ty with them, and with your unfamiliarity with the ASP.Net
programming paradigm. When used correctly, ASP.Net Controls do whatever
you want them to do, and very well.

no they don't, I think the tasks you are doing may be very basic.
<snip>

I've been doing ASP.Net since the first beta version came out, and I've
done just about everything with ASP.Net that can be done with it, except
for Ajax. I've built a large number of web sites with it, Controls that
interact with SWFs that interact with Web Services that I've built,
HttpHandlers for a variety of purposes, member- and role-based portals
that have database back-ends, database interfaces, Controls that render
images and charts, Controls that use XSLT to create HTML from serialized
sets of custom classes, Controls that render JavaScript, so much stuff
that I don't remember some of it.

Over the years, I've learned to use Controls more, not less, by experience
and research. I have a large personal library of custom Controls that I
have previously built, and employ in projects that come up.

That said, you don't have to believe me. The information I've provided was
for your benefit, not mine. Someday it may be useful to you, if not today.
I believe you are very capable, but I don't agree that controls are as
flexible as spitting out html. You did not comment on the scenarios I put
forward, remembering that the ability to do something is not the point, it
is if it is practice to do so.

"In some occasions you may not even know the amount of data, number of
fields, data types you will need to display, controls can not handle this
well and present the data formatted correctly on the fly. Some times
condition statements may be needed to decide when to display, make a
calculation or separate the data from one column to 2. Controls can not
handle this well. In these cases it is far more productive to use html"

--
HTH,

Kevin Spencer
Microsoft MVP

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

Oct 17 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
9624
by: Hari | last post by:
What is the difference between HTML controls, HTML server controls , ASP.Net controls? Which will give more performance?
3
2654
by: Steve Drake | last post by:
All, I have a CONTROL that contains 1 control (Control ONE), the 1 control that it can contain 1 or 2 control (Control A and B). Control A, raises and event and Control ONE receives this event and this causes control B to be created, when this is done the VIEWSTATE is lost for CONTROL B. In the EVENT that causes CONTROL B to be created I have to set
5
2607
by: Mong | last post by:
Hi, I have a webform with various asp controls on it such as textboxes and dropdownlists. I'm fairly new to asp.net coming from VB6 and am wondering when it's best to use client side events and when it's best to use server side events. For example, if a textbox is to contain a date I want to validate the date when that textbox loses the focus. If the date is not valid I make visible a label next to the textbox telling the user it's
10
5328
by: Sacha Korell | last post by:
I'm trying to load a drop-down list with all DropDownList control names from another page. How would I be able to find those DropDownList controls? The FindControl method will only find a certain control by id, but I want to find all controls of a certain type (DropDownList in this case). Is there an easier way than to get a control count of the page, loop through all controls on that page, examine their type and, if they're a...
5
6536
by: siaj | last post by:
Hello All, Can any one give me a clue when to use Web Server controls/ HTML server controls/HTML Controls. As I understand .. HTML controls should be used if u dont need to refer it in the code behind a(simply bcaz it is not recognized in the code behind IDE) and it does not make a server trip. HTML server Controls should be preferred over Web Server controls as they are light weight than ASP.NET web Server controls.(If they have same...
5
2095
by: Brian Kitt | last post by:
I have a C# application that builds dynamic HTML and renders it. Because it is rendered in this way, the input controls are not server controls. I write the entire page, which has a variable number of detail lines for an order. I want the user to be able to change values on these detail lines and hit an 'update' button. I know how to do this in Javascript, but I'd like to be able to inspect the controls that come back to my C# program...
4
2461
by: SAI | last post by:
Both have "TextBox" element and "Runat server". I don't understand the difference. Please advise. Thanks.
22
2198
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said stage. One approach I have used on other systems is to prevent the action buttons appearing. For example, if one did not have the Role of Administrator, one would be prevented from deleting a ticket not created by oneself. However, it did occur...
8
3194
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem I'm having is that the partial class signature in my projectDetails.ascx.cs file looks like this: public partial class ProjectDetailsControl<TEntryServiceProvider: UserControl, INamingContainer where TEntryServiceProvider : IEntryServiceProvider...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10359
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9177
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.