Hi all,
With the advent of Service Pack 1 for Visual Studio 2005 we at last get
a possibility
to convert our old ASP.Net 1.1 web application to ASP.Net 2.0. We
converted it. And we were unpleasantly impressed. There are many just
praises about reduced ViewState but what about another controls?
For example:
LinkButton that causes validation renders as hyperlink with the script
in href attribute.
ASP.Net 1.1 (117 b)
javascript:{if (typeof(Page_ClientValidate) != 'function' ||
Page_ClientValidate()) __doPostBack('LinkButton1','')}
ASP.Net 2.0 (156 b)
javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("LinkButton1", "", true,
"", "", false, true))
You may say, that difference in 39 bytes is not so much. But with a
little rewriting of the source file it would be looked like
javascript:WebForm_DoPostBackWithOptions('LinkButt on1','',true,'','',false,true)
and difference become more essential. It's looks like nobody in VS2005
developer's team tries to optimize code.
I want to particularly point to validators:
ASP.Net 1.1 (241 b)
<span id="RequiredFieldValidator1" controltovalidate="TextBox1"
errormessage="Value required" display="Dynamic"
evaluationfunction="RequiredFieldValidatorEvaluate IsValid"
initialvalue="" style="color:Red;display:none;">Value required</span>
ASP.Net 2.0 (520 b)
<span id="RequiredFieldValidator1"
style="color:Red;display:none;">Value required</span>
+
script in the body of a page:
var RequiredFieldValidator1 = document.all ?
document.all["RequiredFieldValidator1"] :
document.getElementById("RequiredFieldValidator1") ;
RequiredFieldValidator1.controltovalidate = "TextBox1";
RequiredFieldValidator1.errormessage = "Value required";
RequiredFieldValidator1.display = "Dynamic";
RequiredFieldValidator1.evaluationfunction =
"RequiredFieldValidatorEvaluateIsValid";
RequiredFieldValidator1.initialvalue = "";
Four validators on a page - 1kB of the additional traffic. Pretty
good, isn't it?
Or I am wrong and in the most countries internet has already changed to
intranet and page size is unimportant?
Would like to hear expert's opinions.
Sorry for my English.
P.S. Source for all examples is empty page + 3 controls:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:LinkButton ID="LinkButton1"
runat="server">LinkButton</asp:LinkButton>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1"
Display="Dynamic" ErrorMessage="Value
required"></asp:RequiredFieldValidator> 3 1309
Thanks for anwser, Nate
I have nothing against cross-browswer compliant script, I do not
understand whether it is necessary put all code in the page body
instead of separate file.
As for custom validators: either it supports existing validation schema
(and has no any advantages) or implements its own (but it causes
rewriting all controls that use old schema: Button, LinkButton, etc).
ms decided xhtml conformance was desirable. this means no custom
attributes are allowed, so they had to be moved to javascript objects
and quotes must be quoted.
-- bruce (sqlwork.com)
marss wrote:
Hi all,
With the advent of Service Pack 1 for Visual Studio 2005 we at last get
a possibility
to convert our old ASP.Net 1.1 web application to ASP.Net 2.0. We
converted it. And we were unpleasantly impressed. There are many just
praises about reduced ViewState but what about another controls?
For example:
LinkButton that causes validation renders as hyperlink with the script
in href attribute.
ASP.Net 1.1 (117 b)
javascript:{if (typeof(Page_ClientValidate) != 'function' ||
Page_ClientValidate()) __doPostBack('LinkButton1','')}
ASP.Net 2.0 (156 b)
javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("LinkButton1", "", true,
"", "", false, true))
You may say, that difference in 39 bytes is not so much. But with a
little rewriting of the source file it would be looked like
javascript:WebForm_DoPostBackWithOptions('LinkButt on1','',true,'','',false,true)
and difference become more essential. It's looks like nobody in VS2005
developer's team tries to optimize code.
I want to particularly point to validators:
ASP.Net 1.1 (241 b)
<span id="RequiredFieldValidator1" controltovalidate="TextBox1"
errormessage="Value required" display="Dynamic"
evaluationfunction="RequiredFieldValidatorEvaluate IsValid"
initialvalue="" style="color:Red;display:none;">Value required</span>
ASP.Net 2.0 (520 b)
<span id="RequiredFieldValidator1"
style="color:Red;display:none;">Value required</span>
+
script in the body of a page:
var RequiredFieldValidator1 = document.all ?
document.all["RequiredFieldValidator1"] :
document.getElementById("RequiredFieldValidator1") ;
RequiredFieldValidator1.controltovalidate = "TextBox1";
RequiredFieldValidator1.errormessage = "Value required";
RequiredFieldValidator1.display = "Dynamic";
RequiredFieldValidator1.evaluationfunction =
"RequiredFieldValidatorEvaluateIsValid";
RequiredFieldValidator1.initialvalue = "";
Four validators on a page - 1kB of the additional traffic. Pretty
good, isn't it?
Or I am wrong and in the most countries internet has already changed to
intranet and page size is unimportant?
Would like to hear expert's opinions.
Sorry for my English.
P.S. Source for all examples is empty page + 3 controls:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:LinkButton ID="LinkButton1"
runat="server">LinkButton</asp:LinkButton>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1"
Display="Dynamic" ErrorMessage="Value
required"></asp:RequiredFieldValidator>
bruce barker wrote:
ms decided xhtml conformance was desirable. this means no custom
attributes are allowed, so they had to be moved to javascript objects
and quotes must be quoted.
-- bruce (sqlwork.com)
Hello, Bruce,
I completely disagree with you about impossibility of custom attributes
use in xhtml compliant pages, but anyway, thanks for your opinion. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Michael Brennan-White |
last post by:
If I submit my for using a get action the resulting page loads . If I
use a post action I get an error page saying "The page cannot be
found". I am calling the originating page!!! This happens...
|
by: Arun Nair |
last post by:
Hi,
I have the following jsp page. I am able to view only a part of
it(until the occurence of the first City text box). If i remove the
first few fields from the page, I am able to see a few...
|
by: Drew |
last post by:
I have a db table like the following,
UID, int auto-increment
RegNo
Person
Relation
YearsKnown
Now here is some sample data from this table,
|
by: Nathan |
last post by:
Hi,
I seem to having a peculiar problem with the display of odd and even
pages in XSL-FO. Here is a small background of the problem.
My xsl stylesheet mentions my fo:layout-master-set as
...
|
by: Jeff |
last post by:
Hi -
I have an ASP.NET page that hangs (some times; if it loads for you, try
refresh/F5 several times) when I try to run it on my localhost. It contains
an HTML table for formatting, and within...
|
by: Raja Shekar |
last post by:
HI Every body ,
I would like to know whether is it mandatory to give Tablespace page
size and Bufferpool page size equal..? i also heard like while creating
tablespace if pages size of tablespace...
|
by: scottyman |
last post by:
I can't make this script work properly. I've gone as far as I can with
it and the rest is out of my ability. I can do some html editing but
I'm lost in the Java world. The script at the bottom of...
|
by: soluvah |
last post by:
Hello Folks,
Been trying to widen my site's body from "779" to "1000" so it almost fills the window. IE 7 on windows XP just dismantles the pages and leaves wide gaps between the left column and...
|
by: hsahealthsavings |
last post by:
I made this page using a free html editor called formbreeze. The issue is
1) There is a whole bunch of white space at the end of the page that I cannot seem to figure how to get rid of
2) I have...
|
by: premprakashbhati |
last post by:
hi, good evening..
i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button()
here is the code ...its work fine...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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: 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...
|
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,...
| |