Submit with validation problem

Discussion in 'ASP .Net' started by Alphonse Giambrone, May 12, 2004.

  1. I have a simple login page that has two text boxes, two
    requiredfieldvalidators, a couple of labels and a button. It has been
    reduced down to almost nothing to troubleshoot the below problem.

    Added to a project on development machine (Win XP Pro, IIS 5.1, CLR
    1.1.4322), works fine.
    Deployed to a shared web host (IIS 5.1, CLR 1.1.4322), works fine.

    Added to different project on same development machine, works fine.
    Deployed to 2nd shared host (IIS 6.0, CLR 1.1.4322), FORM DOES NOT SUBMIT!
    Validators seem to be working as if I leave a textbox empty, the
    validator(s) present the appropriate message and there is no message if
    textboxes are filled in.

    It seems to be a problem with the generated javascript.
    I added "/aspnet_client/system_web/1_1_4322/WebUIValidation.js" to the
    application root because I need to utilize functions in it.
    This is the same for all instances.
    I mention this because if I remove the js file, the form will submit
    properly, but then my other pages that need it don't work.

    Here is the generated page source (minus most of the html) from the host
    where the page does NOT submit:
    <body onload="document.frmLogin.txtUserName.focus();">
    <form name="frmLogin" method="post" action="logina.aspx"
    language="javascript" onsubmit="if (!ValidatorOnSubmit()) return false;"
    id="frmLogin">

    <script language="javascript"
    src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>

    <script language="javascript">
    <!--
    var Page_Validators = new Array(document.all["RequiredFieldValidator1"],
    document.all["RequiredFieldValidator2"]);
    // -->
    </script>
    <script language="javascript">
    <!--
    var Page_ValidationActive = false;
    if (typeof(clientInformation) != "undefined" &&
    clientInformation.appName.indexOf("Explorer") != -1) {
    if ((typeof(Page_ValidationVer) != "undefined") && (Page_ValidationVer
    == "125"))
    ValidatorOnLoad();
    }
    function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
    return ValidatorCommonOnSubmit();
    }
    return true;
    }
    // -->
    </script>
    </form>
    </body>

    ==================================================
    Here is the generated page source (minus most of the html) from the host
    (and my development machine) where the page DOES submit:

    <body onload="document.frmLogin.txtUserName.focus();">
    <form name="frmLogin" method="post" action="logina.aspx"
    language="javascript" onsubmit="ValidatorOnSubmit();" id="frmLogin">

    <script language="javascript"
    src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>
    <script language="javascript">
    <!--
    var Page_Validators = new Array(document.all["RequiredFieldValidator1"],
    document.all["RequiredFieldValidator2"]);
    // -->
    </script>
    <script language="javascript">
    <!--
    var Page_ValidationActive = false;
    if (typeof(clientInformation) != "undefined" &&
    clientInformation.appName.indexOf("Explorer") != -1) {
    if ((typeof(Page_ValidationVer) != "undefined") && (Page_ValidationVer
    == "125"))
    ValidatorOnLoad();
    }
    function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
    ValidatorCommonOnSubmit();
    }
    }
    // -->
    </script>
    </form>
    </body>
    ============================================================

    The differences I see are in the form's submit event and the function
    ValidatorOnSubmit().

    Does anyone understand what is going on?
    How to solve?

    TIA
    --

    Alphonse Giambrone
    Email: a-giam at customdatasolutions dot us
     
    Alphonse Giambrone, May 12, 2004
    #1
    1. Advertising

  2. Hi Alphonse,

    From your description, you have a simple page which contains two textboxes
    and two RequiredFieldValidator
    Control to validate textboxes, also a button to submit the page. This
    worked well on the dev machine winxp pro
    iis5 and also ok on a win2k server machine
    but the page can't be submit on a w2k3 machine with IIS6. You also menioned
    that you have manually copy the /aspnet_client (clienside scripts) folder
    from the other mahcine to the w2k3 server machine, yes?

    As for the WebUIValidation.js file under the /aspnet_client root folder ,
    it contains the clientside scripts which is required for the ASP.NET
    valication control's clientside validation. Also, this file together with
    other ASP.NET required clientside resources under the /aspnet_client root
    folder can be installed via the "aspnet_regiis.exe" tool.

    We should use the
    aspnet_regiis -c command
    to install the clientside resources for asp.net rather copy from other
    machines. For detailed info on the aspnet_regiis tool, you can view the
    following referece in msdn:

    #ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
    http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfASPNETIISRegistrat
    ionToolAspnet_regiisexe.asp?frame=true

    So I sugggest you remove the /aspnet_client folder you manually copyed from
    other machines and when to the .net's installed folder
    %SYSTEM%\Microsoft.NET\Framework\v1.1.4322\
    in commandline
    and execute the
    aspnet_regiis -c command to reinstall the clienside resources and test
    again.

    If you have anything unclear or have any new findings, please feel free to
    post here. Thanks.


    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], May 13, 2004
    #2
    1. Advertising

  3. Steven,

    Thanks for the reply.
    If I read the article correctly, Aspnet_regiis.exe must be run from the
    command line on the server.
    This is not an option as it is a shared commercial host.

    --

    Alphonse Giambrone
    Email: a-giam at customdatasolutions dot us


    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Hi Alphonse,
    >
    > From your description, you have a simple page which contains two

    textboxes
    > and two RequiredFieldValidator
    > Control to validate textboxes, also a button to submit the page. This
    > worked well on the dev machine winxp pro
    > iis5 and also ok on a win2k server machine
    > but the page can't be submit on a w2k3 machine with IIS6. You also

    menioned
    > that you have manually copy the /aspnet_client (clienside scripts) folder
    > from the other mahcine to the w2k3 server machine, yes?
    >
    > As for the WebUIValidation.js file under the /aspnet_client root folder ,
    > it contains the clientside scripts which is required for the ASP.NET
    > valication control's clientside validation. Also, this file together with
    > other ASP.NET required clientside resources under the /aspnet_client root
    > folder can be installed via the "aspnet_regiis.exe" tool.
    >
    > We should use the
    > aspnet_regiis -c command
    > to install the clientside resources for asp.net rather copy from other
    > machines. For detailed info on the aspnet_regiis tool, you can view the
    > following referece in msdn:
    >
    > #ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
    >

    http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfASPNETIISRegistrat
    > ionToolAspnet_regiisexe.asp?frame=true
    >
    > So I sugggest you remove the /aspnet_client folder you manually copyed

    from
    > other machines and when to the .net's installed folder
    > %SYSTEM%\Microsoft.NET\Framework\v1.1.4322\
    > in commandline
    > and execute the
    > aspnet_regiis -c command to reinstall the clienside resources and test
    > again.
    >
    > If you have anything unclear or have any new findings, please feel free to
    > post here. Thanks.
    >
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    > Get Preview at ASP.NET whidbey
    > http://msdn.microsoft.com/asp.net/whidbey/default.aspx
    >
    >
    >
    >
     
    Alphonse Giambrone, May 13, 2004
    #3
  4. Fixed it!

    Finally got a friendly tech support person and he installed the client
    script files and all works now.

    --

    Alphonse Giambrone
    Email: a-giam at customdatasolutions dot us


    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Hi Alphonse,
    >
    > From your description, you have a simple page which contains two

    textboxes
    > and two RequiredFieldValidator
    > Control to validate textboxes, also a button to submit the page. This
    > worked well on the dev machine winxp pro
    > iis5 and also ok on a win2k server machine
    > but the page can't be submit on a w2k3 machine with IIS6. You also

    menioned
    > that you have manually copy the /aspnet_client (clienside scripts) folder
    > from the other mahcine to the w2k3 server machine, yes?
    >
    > As for the WebUIValidation.js file under the /aspnet_client root folder ,
    > it contains the clientside scripts which is required for the ASP.NET
    > valication control's clientside validation. Also, this file together with
    > other ASP.NET required clientside resources under the /aspnet_client root
    > folder can be installed via the "aspnet_regiis.exe" tool.
    >
    > We should use the
    > aspnet_regiis -c command
    > to install the clientside resources for asp.net rather copy from other
    > machines. For detailed info on the aspnet_regiis tool, you can view the
    > following referece in msdn:
    >
    > #ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
    >

    http://msdn.microsoft.com/library/en-us/cptools/html/cpgrfASPNETIISRegistrat
    > ionToolAspnet_regiisexe.asp?frame=true
    >
    > So I sugggest you remove the /aspnet_client folder you manually copyed

    from
    > other machines and when to the .net's installed folder
    > %SYSTEM%\Microsoft.NET\Framework\v1.1.4322\
    > in commandline
    > and execute the
    > aspnet_regiis -c command to reinstall the clienside resources and test
    > again.
    >
    > If you have anything unclear or have any new findings, please feel free to
    > post here. Thanks.
    >
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    > Get Preview at ASP.NET whidbey
    > http://msdn.microsoft.com/asp.net/whidbey/default.aspx
    >
    >
    >
    >
     
    Alphonse Giambrone, May 13, 2004
    #4
  5. Steven Cheng[MSFT], May 14, 2004
    #5
    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. Mark
    Replies:
    1
    Views:
    1,737
  2. Ghafran Abbas
    Replies:
    0
    Views:
    4,258
    Ghafran Abbas
    Oct 12, 2004
  3. aljodo
    Replies:
    3
    Views:
    3,082
    Peter Blum
    Aug 26, 2005
  4. =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=

    Problem - Summary Validation, need to submit twice to fire

    =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=, Mar 6, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    392
    =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=
    Mar 6, 2007
  5. Joop
    Replies:
    5
    Views:
    615
Loading...

Share This Page