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? 4 1224
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**************@TK2MSFTNGP12.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.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?
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.public.dotnet.framework.aspnet NNTP-Posting-Host: host230-178.discord.birch.net 65.16.230.178 Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!cpmsftng xa09.phx.gbl!TK2MSFTNGP08.
phx.gbl!TK2MSFTNGP12.phx.gblXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:206162 X-Tomcat-NG: microsoft.public.dotnet.framework.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?
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**************@TK2MSFTNGP09.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**************@TK2MSFTNGP12.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.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?
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.public.dotnet.framework.aspnet NNTP-Posting-Host: host230-178.discord.birch.net 65.16.230.178 Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!cpmsftng xa10.phx.gbl!TK2MSFTNGXA05
.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:206191 X-Tomcat-NG: microsoft.public.dotnet.framework.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**************@TK2MSFTNGP09.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**************@TK2MSFTNGP12.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.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?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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?
...
|
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...
|
by: Hari |
last post by:
What is the difference between HTML controls, HTML server
controls , ASP.Net controls?
Which will give more performance?
|
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...
|
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...
|
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...
|
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
|
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...
|
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...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
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,...
| | |