Javascript slowing down page in ie6

2 posts, 0 answers
  1. Jomey
    Jomey avatar
    60 posts
    Member since:
    Jan 2008

    Posted 03 Jul 2008 Link to this post

    I have datepicker user control and run this on load.

    In ie6 it loads the page for a couple seconds then it refreshes the page once it finishes loading the javascript.  The below script is run for each calendar.  I have tons of calendars on the page - over 25.

    Is there a solution to the page refresh.  In ie7 it doesn't refresh - it just takes longer to load.

    string
    script = string.Format(@"

    var {0}invalidInput = false;

    var {0}errmessage = '';

    function {0}_ShowDetails()

    {{

    var pnlName = '{0}_pnlDetails';

    var myPanel = document.getElementById(pnlName);

    if (myPanel != undefined)

    {{

    myPanel.style.display='block';

    var rfvName = '{0}_rfv';

    var ReqValidator = document.getElementById(rfvName);

    ValidatorEnable(ReqValidator,true);

    }}

    }}

    function {0}_HideDetails()

    {{

    var pnlName = '{0}_pnlDetails';

    var myPanel = document.getElementById(pnlName);

    if (myPanel != undefined)

    {{

    myPanel.style.display='none';

    var rfvName = '{0}_rfv';

    var ReqValidator = document.getElementById(rfvName);

    ValidatorEnable(ReqValidator,false);

    }}

    }}

    function {0}_OnDateSelected(sender, args)

    {{

    {0}invalidInput = false;

    {0}_ShowDetails();

    }}

    function {0}_OnError(sender, args)

    {{

    if (args.get_reason() == Telerik.Web.UI.InputErrorReason.ParseError)

    {{

    {0}errmessage='Date must be in valid format (mm/dd/yyyy)';

    {0}invalidInput = true;

    }}

    else if (args.get_reason() == Telerik.Web.UI.InputErrorReason.OutOfRange)

    {{

    {0}errmessage='Date out of range';

    {0}invalidInput = true;

    }}

    alert({0}errmessage);

    }}

    function {0}_CustomValidate(sender, args)

    {{

    var customVal = document.all ? document.all['{1}'] : document.getElementById('{1}');

    customVal.errormessage = {0}errmessage;

    if ({0}invalidInput)

    args.IsValid = false;

    }}

    function {0}_OnBlur(sender, args)

    {{

    if (sender.GetTextBoxValue() == '')

    {{

    {0}invalidInput = false;

    }}

    }}"

    , this.ClientID, CustomValidator1.ClientID);

    RadDatePicker picker = (RadDatePicker)RadDatePicker1;

    RadDatePicker1.DateInput.ClientEvents.OnError =

    string.Format("{0}_OnError", this.ClientID);

    RadDatePicker1.DateInput.ClientEvents.OnBlur =

    string.Format("{0}_OnBlur", this.ClientID);

    RadDatePicker1.ClientEvents.OnDateSelected =

    string.Format("{0}_OnDateSelected", this.ClientID);

    CustomValidator1.ClientValidationFunction =

    string.Format("{0}_CustomValidate", this.ClientID);

  2. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 07 Jul 2008 Link to this post

    Hello Jomey,

    We are not sure what is causing the behavior you are observing. It will be best if you open a support ticket and attach to it a small runnable sample which reproduces the issue. Thus we will examine it an get back to you with our findings.

    Best wishes,
    Pavel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top