Web page size

Discussion in 'ASP .Net Web Controls' started by marss, Jan 12, 2007.

  1. marss

    marss Guest

    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('LinkButton1','',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="RequiredFieldValidatorEvaluateIsValid"
    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>
    marss, Jan 12, 2007
    #1
    1. Advertising

  2. marss

    marss Guest

    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).
    marss, Jan 12, 2007
    #2
    1. Advertising

  3. marss

    bruce barker Guest

    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(&quot;LinkButton1&quot;, &quot;&quot;, true,
    > &quot;&quot;, &quot;&quot;, 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('LinkButton1','',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="RequiredFieldValidatorEvaluateIsValid"
    > 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, Jan 12, 2007
    #3
  4. marss

    marss Guest

    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.
    marss, Jan 15, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Madhanmohan S
    Replies:
    5
    Views:
    7,707
    Madhanmohan S
    Sep 3, 2004
  2. Reny J Joseph Thuthikattu
    Replies:
    1
    Views:
    542
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Dec 30, 2004
  3. lazy

    string size greater than page size?

    lazy, Apr 27, 2007, in forum: C Programming
    Replies:
    3
    Views:
    347
    Army1987
    Apr 27, 2007
  4. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    12,519
    Michael Jung
    May 25, 2008
  5. Replies:
    3
    Views:
    355
Loading...

Share This Page