Showing posts with label instead. Show all posts
Showing posts with label instead. Show all posts

Saturday, March 24, 2012

HTML Elements vs. WebControls?

What are the pros and cons to using each?

For example, why should I use the asp.net textbox instead of the HTML element textbox?

This has been confusing me for awhile now.

Thanks for any input.

JamesHTML server controls
==============
HTML elements exposed to the server so you can program them. HTML server controls expose an object model that maps very closely to the HTML elements that they render.

Web server controls
=============
Controls with more built-in features than HTML server controls. Web server controls include not only form-type controls such as buttons and text boxes, but also special-purpose controls such as a calendar. Web server controls are more abstract than HTML server controls in that their object model does not necessarily reflect HTML syntax
Web Server controls require more overhead... if you are concern about performance then I woud go with Html server controls. (Not a huge difference though...)

Thursday, March 22, 2012

HTML controls instead of .Net server controls

Another front end guy that I work with wants to use old HTML controls instead
of the new .NET server controls. Since he is a old HTML and classic asp
person and is familiar with this, he wants to the old HTML controls instead
of the new .Net controls on a .Net web page. Please give me some opinions on
this. What are disadvantages or advantages, if any?

PS - I only use the new .Net controls. Never have used the old control
except for the file upload.

--
Chris DavoliJeesh. Tell him to wake up and join the 21st century. Really, man.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Chris Davoli" wrote:

Quote:

Originally Posted by

Another front end guy that I work with wants to use old HTML controls instead
of the new .NET server controls. Since he is a old HTML and classic asp
person and is familiar with this, he wants to the old HTML controls instead
of the new .Net controls on a .Net web page. Please give me some opinions on
this. What are disadvantages or advantages, if any?
>
PS - I only use the new .Net controls. Never have used the old control
except for the file upload.
>
--
Chris Davoli
>


Peter Bromberg [C# MVP] napisa?(a):

Quote:

Originally Posted by

Jeesh. Tell him to wake up and join the 21st century. Really, man.
Peter


Web server controls are not always the best choice. If you want to take
care of quality of your (x)html code (in terms of web standards) and
build modern, cross-browser websites, you often must forget about some
of web controls because they're generating ugly and old-fashioned
markup. Especially in ASP.NET 1.1 that was a big problem. In that cases
html server controls was good alternative because you had full control
(almost) of the code you generate. Of course it requires some more
knowledge and skills (properly use (x)html - to deliver content and not
presentation, css to deliver presentational informatons and
javascript(ecmascript) to add behaviors) than using web server controls,
but its definitely good idea if we talk about modern, accessible and
cross-browser websites.
Html server controls have one more advantage - lower performance cost
than most of server controls.
So it's not so easy decision to get rid of html server controls and
advance into 21th century:)

--
It was my opinion and i'm definitely agree with it:)
PP
I was once an old school HTML instead of .Net but with VS2005 they have come a
long, long way. There are just to many advantages to ignore the new controls. I
don't event think about it anymore - the performance hit on most web pages is
insignificant - use the new controls.

On Fri, 15 Sep 2006 18:46:01 -0700, Chris Davoli
<ChrisDavoli@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

>Another front end guy that I work with wants to use old HTML controls instead
>of the new .NET server controls. Since he is a old HTML and classic asp
>person and is familiar with this, he wants to the old HTML controls instead
>of the new .Net controls on a .Net web page. Please give me some opinions on
>this. What are disadvantages or advantages, if any?
>
>PS - I only use the new .Net controls. Never have used the old control
>except for the file upload.

Wednesday, March 21, 2012

Html 4.01 strict instead of xhtml?

Can I stop asp.net from applying self closing tags? I am trying to generate
an html 4.01 strict page rather than an xhtml page and the w3 validator is
unhappy about asp.net automatically translating this:
<link rel="stylesheet" href="http://links.10026.com/?link=SkinStyle.aspx?SkinName=Test" type="text/css">
to this:
<link rel="stylesheet" href="http://links.10026.com/?link=SkinStyle.aspx?SkinName=Test" type="text/css"
/>Hi Andy,
Regarding on the ASP.NET/VS IDE html formatting question you mentioned
they're actually controlled by the HTML Designer's formatting and
validation setting. You can configure them through the following approaches:
For the automatically close tag behavior, you can set it through the below
steps:
**open "tools --> options" menu,
** in the opened dialog, choose the following path in left view:
Text Editor-->HTML-->Format-->
and you'll find the "Auto Insert close Tag" check option
for the design-time validation(against html), you can also find the
following setting:
Text Editor-->HTML-->Validation --> "Target:"
you can choose "HTML 4.01" as your ASPX page's target validation
schema(instead of xhtml 1.0)
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
========================================
==========
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...t/default.aspx.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT] wrote:
> Hi Andy,
> Regarding on the ASP.NET/VS IDE html formatting question you mentioned
> they're actually controlled by the HTML Designer's formatting and
> validation setting. You can configure them through the following
> approaches:
> For the automatically close tag behavior, you can set it through the
> below steps:
> **open "tools --> options" menu,
> ** in the opened dialog, choose the following path in left view:
> Text Editor-->HTML-->Format-->
> and you'll find the "Auto Insert close Tag" check option
Hi, thanks for your help! I just tried this but it didn't make a difference.
The tag doesn't have self closing tags in the designer, only in the
outputted html.
Hi Andy,
Thanks for your reply and the further clarify.
Actually, I originally assume that you just want to change the edit
experience in IDE at design-time. So you also want the runtime html output
be formated without close tag ( "/>"), right?
I've performed some further test, actually, ASP.NET 2.0 runtime can let you
specify the "xhtmlConformance" to a "Legacy" value so that the output will
conform to ASP.NET 1.1 format, e.g.
===========
.........
<xhtmlConformance mode="Legacy"/>
</system.web>
============
However, when running the aspx page, such as below:
============
<html >
<head runat="server">
<link rel="stylesheet" href="http://links.10026.com/?link=SkinStyle.aspx?SkinName=Test" type="text/css">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" >
</div>
</form>
</body>
</html>
==============
the <input type="button" > can be keep without close tag, the <link ...>
will be formated to <link ... />. It seems the runtime engine will
transalte the tags in <head> section and ensure closing tag and there
hasn't any declarative means to configure this.
So far I think one way to overcome this behavior would be manually
customize the ASP.NET page's response output through a Response Filter
stream. You can attach a Filter for each Page's Response and modify the
response content. Here is a web article demonstrate using response Filter
to customize(format) page output:
http://aspnetresources.com/articles/HttpFilters.aspx
Producing XHTML-Compliant Pages With Response Filters
For your scenario, you may use it to change all the "/>" close tag to ">".
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT] wrote:
> So far I think one way to overcome this behavior would be manually
> customize the ASP.NET page's response output through a Response Filter
> stream. You can attach a Filter for each Page's Response and modify
> the response content. Here is a web article demonstrate using
> response Filter to customize(format) page output:
> http://aspnetresources.com/articles/HttpFilters.aspx
> Producing XHTML-Compliant Pages With Response Filters
> For your scenario, you may use it to change all the "/>" close tag to
> ">".
Perfect, thank you!
You're welcome :)
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead

Html 4.01 strict instead of xhtml?

Can I stop asp.net from applying self closing tags? I am trying to generate
an html 4.01 strict page rather than an xhtml page and the w3 validator is
unhappy about asp.net automatically translating this:

<link rel="stylesheet" href="http://links.10026.com/?link=SkinStyle.aspx?SkinName=Test" type="text/css">

to this:

<link rel="stylesheet" href="http://links.10026.com/?link=SkinStyle.aspx?SkinName=Test" type="text/css"
/>Hi Andy,

Regarding on the ASP.NET/VS IDE html formatting question you mentioned
they're actually controlled by the HTML Designer's formatting and
validation setting. You can configure them through the following approaches:

For the automatically close tag behavior, you can set it through the below
steps:

**open "tools --options" menu,

** in the opened dialog, choose the following path in left view:

Text Editor-->HTML-->Format-->

and you'll find the "Auto Insert close Tag" check option

for the design-time validation(against html), you can also find the
following setting:

Text Editor-->HTML-->Validation --"Target:"

you can choose "HTML 4.01" as your ASPX page's target validation
schema(instead of xhtml 1.0)

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...rt/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT] wrote:

Quote:

Originally Posted by

Hi Andy,
>
Regarding on the ASP.NET/VS IDE html formatting question you mentioned
they're actually controlled by the HTML Designer's formatting and
validation setting. You can configure them through the following
approaches:
>
For the automatically close tag behavior, you can set it through the
below steps:
>
**open "tools --options" menu,
>
** in the opened dialog, choose the following path in left view:
>
Text Editor-->HTML-->Format-->
>
and you'll find the "Auto Insert close Tag" check option


Hi, thanks for your help! I just tried this but it didn't make a difference.
The tag doesn't have self closing tags in the designer, only in the
outputted html.
Steven Cheng[MSFT] wrote:

Quote:

Originally Posted by

So far I think one way to overcome this behavior would be manually
customize the ASP.NET page's response output through a Response Filter
stream. You can attach a Filter for each Page's Response and modify
the response content. Here is a web article demonstrate using
response Filter to customize(format) page output:
>
http://aspnetresources.com/articles/HttpFilters.aspx
Producing XHTML-Compliant Pages With Response Filters
>
For your scenario, you may use it to change all the "/>" close tag to
">".


Perfect, thank you!
You're welcome :)

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead