Performance-related questions about an ASP.NET page...

S

Sammy

1- Is it better to use TABLEs or DIVs in an HTML/ASP.NET page? Why?
2- Is it better to form your response (HTML page) result from your ASP.NET
page mostly using server side controls, or HTML controls. For example, if
you want to display the word "Welcome" is it better to use an asp:label
control or just type it using a P tag?

Thank you.
 
K

Karl Seguin

Sammy:
The table/div issue has nothing to do with ASP.Net...it's more a general
html question...a nice thing about tables is how well they let you structure
data using server-side controls via the Table, TableRow and TableCell
controls. If you do a google search for "Table vs Div" you'll get a lot of
results. The main issue i believe is accessibility....

Your second question is loaded, but i'll answer it as best as possible.
First off, it's pretty obvious that

#1
<p>Hello World</p>

is going to be faster than

#2
<Asp:label id="blah" runat="server" />
....
OnPage_Load
blah.text = "hello world"
end sub

in the first example you are simply sending it as plain text to the browser
to render. In the 2nd example, ur doing the same thing, but before that you
are creating an object on the server and doing some other magic.

The real point though is that it shouldn't matter. The debate is purely
speculative...the microsecond (literally) that you'll save in one way
doesn't equate much compared to the flexibility you gain the other. If the
flexiliby isn't, and never will be needed, then do it the first way..

Karl
 
S

Sammy

Thank you!

Karl Seguin said:
Sammy:
The table/div issue has nothing to do with ASP.Net...it's more a general
html question...a nice thing about tables is how well they let you
structure
data using server-side controls via the Table, TableRow and TableCell
controls. If you do a google search for "Table vs Div" you'll get a lot
of
results. The main issue i believe is accessibility....

Your second question is loaded, but i'll answer it as best as possible.
First off, it's pretty obvious that

#1
<p>Hello World</p>

is going to be faster than

#2
<Asp:label id="blah" runat="server" />
...
OnPage_Load
blah.text = "hello world"
end sub

in the first example you are simply sending it as plain text to the
browser
to render. In the 2nd example, ur doing the same thing, but before that
you
are creating an object on the server and doing some other magic.

The real point though is that it shouldn't matter. The debate is purely
speculative...the microsecond (literally) that you'll save in one way
doesn't equate much compared to the flexibility you gain the other. If
the
flexiliby isn't, and never will be needed, then do it the first way..

Karl
 

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

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,999
Latest member
MakersCBDGummiesReview

Latest Threads

Top