473,804 Members | 4,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS, HTML, ASP.NET - performance??

Hi!

I wonder if I get any performance hit when I do following with some of my
user controls:

I don't have HTML section, but instead, I use code like;
this.Controls.A dd(new LiteralControl( "<div id=\"MdlHd\">" + article.Title +
"</div>"));

to populate HTML.

This gives me flexibility for using CSS and I can target different browsers.
I also save a lot of network traffic.

Am I doing right thing or it is a bad practice?


Nov 18 '05 #1
4 1238
Hi Ivan,

I've been stuggling with the same thing. Apparently you want to use the ID
of the Control for your CSS. Because ASP.Net renames client-side IDs, you
want to preserve the ID. However, this makes maintaining the app much more
difficult, effectively eliminating the advantage of using a Template. I'm
thinking more along the lines of using CSS classes, which don't get renamed.
I think it would be great if MS came up with a "Dynamic StyleSheet" which
would translate the IDs per page.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ivan Demkovitch" <i@a.b> wrote in message
news:uR******** ******@TK2MSFTN GP12.phx.gbl...
Hi!

I wonder if I get any performance hit when I do following with some of my
user controls:

I don't have HTML section, but instead, I use code like;
this.Controls.A dd(new LiteralControl( "<div id=\"MdlHd\">" + article.Title + "</div>"));

to populate HTML.

This gives me flexibility for using CSS and I can target different browsers. I also save a lot of network traffic.

Am I doing right thing or it is a bad practice?

Nov 18 '05 #2
Hmm... you are essentially creating an Object, when all you want to do is
add text to your html output. This is bad.
Creating objects is expensive, though you may find the flexibility you're
getting from it very worth it. If you only have 10 users to this site, and
it can keep up, why not? If you want scalability, you are heading in the
wrong direction.

--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).
--------------------
From: "Ivan Demkovitch" <i@a.b>
Subject: CSS, HTML, ASP.NET - performance??
Date: Thu, 29 Jan 2004 11:52:21 -0600
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <uR************ **@TK2MSFTNGP12 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: host230-178.discord.bir ch.net 65.16.230.178
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!cpm sftngxa09.phx.g bl!TK2MSFTNGP08 .
phx.gbl!TK2MSFT NGP12.phx.gblXref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2061 62
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Hi!

I wonder if I get any performance hit when I do following with some of my
user controls:

I don't have HTML section, but instead, I use code like;
this.Controls. Add(new LiteralControl( "<div id=\"MdlHd\">" + article.Title +
"</div>"));

to populate HTML.

This gives me flexibility for using CSS and I can target different browsers.I also save a lot of network traffic.

Am I doing right thing or it is a bad practice?



Nov 18 '05 #3
Thanks everyone for replys!

I understand issues with handling events and ID's

But I think I head in right direction. I don't use this approach for
everything.
But some "blocks" - or user controls in my page don't need flexibility.
Those are that display only and don't need user
interaction, but do need dynamic content.

Some times it's just a text or a hyperlinks. And I found it to be a big
savings to not have Labels
because of this <span> tags.
Especially for DataLists, even not making it table, it will include <Span>
for each item.

As far as CSS - I think it works ok for me. Instead of panels I use <DIV>
with runat =server and their ID's fine.
I use it for main page layout..

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:ux******** ******@TK2MSFTN GP09.phx.gbl...
Hi Ivan,

I've been stuggling with the same thing. Apparently you want to use the ID
of the Control for your CSS. Because ASP.Net renames client-side IDs, you
want to preserve the ID. However, this makes maintaining the app much more
difficult, effectively eliminating the advantage of using a Template. I'm
thinking more along the lines of using CSS classes, which don't get renamed. I think it would be great if MS came up with a "Dynamic StyleSheet" which
would translate the IDs per page.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ivan Demkovitch" <i@a.b> wrote in message
news:uR******** ******@TK2MSFTN GP12.phx.gbl...
Hi!

I wonder if I get any performance hit when I do following with some of my user controls:

I don't have HTML section, but instead, I use code like;
this.Controls.A dd(new LiteralControl( "<div id=\"MdlHd\">" +
article.Title +
"</div>"));

to populate HTML.

This gives me flexibility for using CSS and I can target different

browsers.
I also save a lot of network traffic.

Am I doing right thing or it is a bad practice?


Nov 18 '05 #4
Looks good...

--
CharlieN
VSU

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

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
From: "Ivan Demkovitch" <i@a.b>
References: <uR************ **@TK2MSFTNGP12 .phx.gbl> <ux************ **@TK2MSFTNGP09 .phx.gbl> Subject: Re: CSS, HTML, ASP.NET - performance??
Date: Thu, 29 Jan 2004 13:08:11 -0600
Lines: 72
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <ez************ **@TK2MSFTNGP09 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: host230-178.discord.bir ch.net 65.16.230.178
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a06.phx.gbl!cpm sftngxa10.phx.g bl!TK2MSFTNGXA0 5
.phx.gbl!TK2MSF TNGP08.phx.gbl! TK2MSFTNGP09.ph x.gbl Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2061 91
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Thanks everyone for replys!

I understand issues with handling events and ID's

But I think I head in right direction. I don't use this approach for
everything.
But some "blocks" - or user controls in my page don't need flexibility.
Those are that display only and don't need user
interaction, but do need dynamic content.

Some times it's just a text or a hyperlinks. And I found it to be a big
savings to not have Labels
because of this <span> tags.
Especially for DataLists, even not making it table, it will include <Span>
for each item.

As far as CSS - I think it works ok for me. Instead of panels I use <DIV>
with runat =server and their ID's fine.
I use it for main page layout..

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:ux******** ******@TK2MSFTN GP09.phx.gbl...
Hi Ivan,

I've been stuggling with the same thing. Apparently you want to use the ID
of the Control for your CSS. Because ASP.Net renames client-side IDs, you want to preserve the ID. However, this makes maintaining the app much more difficult, effectively eliminating the advantage of using a Template. I'm thinking more along the lines of using CSS classes, which don't get

renamed.
I think it would be great if MS came up with a "Dynamic StyleSheet" which would translate the IDs per page.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ivan Demkovitch" <i@a.b> wrote in message
news:uR******** ******@TK2MSFTN GP12.phx.gbl...
Hi!

I wonder if I get any performance hit when I do following with some of

my user controls:

I don't have HTML section, but instead, I use code like;
this.Controls.A dd(new LiteralControl( "<div id=\"MdlHd\">" +

article.Title
+
"</div>"));

to populate HTML.

This gives me flexibility for using CSS and I can target different

browsers.
I also save a lot of network traffic.

Am I doing right thing or it is a bad practice?




Nov 18 '05 #5

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

Similar topics

28
1933
by: petermichaux | last post by:
Hi, On my computer apache will see php in .php documents but not in .html documents. Can I configure apache to see php in .html documents? Or is this something that cannot be done at all? Thanks, Peter
4
2486
by: jason | last post by:
I would appreciate some help on how to convert a database table into an html file via FSO and whether more seasoned asp programmers recommned this route. The main reason I am attempting to do this is becuase we are constantly being told by so-called marketing gurus that 'html' pages are more search engine friendly. Other advantages include speed of download. Will there be any problems with using this approach besides establishing...
1
9623
by: Hari | last post by:
What is the difference between HTML controls, HTML server controls , ASP.Net controls? Which will give more performance?
1
1464
by: vanisathish | last post by:
Hi, Currently we are updating the html page contents, some text boxes using javascript. Is it possible to update the same from am activeX dll. And in javascript, will there be any impact on performance if i send large name=value pairs and then using the split function and assign to appropriate text boxes. Thanks
2
2311
by: Julia Donawald | last post by:
Hi, maybe I am off-topic with my question, so then sorry for this! I am starting of developing an application which consists of a rather complex graphical user-interface and a business-logic part (so that's the usual case, I suppose ;)). There are 4 main reuqirements for the application: 1. Time to market
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...
2
2465
by: Gonçalo Boléo | last post by:
I have no need to have server control over an image. What is the best choice to use HTML img tag or asp:image for best performance? thanks, Goncalo Boleo
59
7050
by: Lennart Björk | last post by:
Hi All, I have a tiny program: <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>MyTitle</title> <meta http-equiv="Content-Type" content="text/html;
3
3907
by: NullQwerty | last post by:
Hey folks, I've got a DataGrid that has gotten a little out of control and really slow because of its complexity (bunch of Template Columns too). For performance reasons, I'm looking to change this. I don't care about development time or even maintainability...at this point I need to go for fastest performance. Which of the following do you think would be quickest?:
0
9710
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
9589
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
10085
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
9163
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...
1
7626
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5527
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...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3830
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3000
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.