Re: Client side validation doesn't work on production server

Discussion in 'ASP .Net' started by Peter Blum, Aug 30, 2004.

  1. Peter Blum

    Peter Blum Guest

    Without the exact error message, we can only guess the cause.

    One of the most common problems when deploying to another server is that the
    user forgets to deploy the /aspnet_client folder with the validation
    scripts.

    Since each ASP.NET version and service pack offers its own
    webUIValidation.js file, this is the most reliable way to install the
    client-side scripts:
    On the server, run:
    [windows]\microsoft.net\framework\[version]\aspnet_regiis.exe -c

    --- Peter Blum
    www.PeterBlum.com
    Email:
    Creator of "Professional Validation And More" at
    http://www.peterblum.com/vam/home.aspx

    "Carlos Esparza via .NET 247" <> wrote in message
    news:...
    > I'm getting an error from a page where a custom validator is located.
    > The strange thing is that the page works correctly on my local machine
    > and on a developement server I've got. But it doesn't work on the
    > production server.
    >
    > This is the clientvalidationfunction
    >
    > function ClientValidate(source, arguments)
    > {
    > /*Check required fields info*/
    > if( document.all.AccountAdd_tbxUserName.value == "" ||
    > document.all.AccountAdd_tbxPassword.value == "" ||
    > document.all.AccountAdd_tbxPasswordConf.value == "" ||
    > document.all.AccountAdd_tbxAnswer.value == "" ||
    > document.all.AccountAdd_tbxFirstName.value == "" ||
    > document.all.AccountAdd_tbxLastName.value == "" ||
    > document.all.AccountAdd_tbxAddress.value == "" ||
    > document.all.AccountAdd_tbxState.value == "" ||
    > document.all.AccountAdd_tbxCity.value == "" ||
    > document.all.AccountAdd_PaymentCtl_tbxBillFirstName.value == "" ||
    > document.all.AccountAdd_PaymentCtl_tbxBillLastName.value == "" ||
    > document.all.AccountAdd_PaymentCtl_tbxBillAddress.value == "" ||
    > document.all.AccountAdd_PaymentCtl_tbxBillZIP.value == "" ||
    > document.all.AccountAdd_PaymentCtl_tbxBillEmail.value == "" )
    > {
    >

    alert("<%Response.Write(Me.dsRM.Tables(0).Rows.Find(Constants.Strings.Accoun
    tInfoEdit_strRequiredFields).ItemArray(1))%>");
    > }
    > /*Check password and password confirmation evenness*/
    > else if( document.all.AccountAdd_tbxPasswordConf.value !=

    document.all.AccountAdd_tbxPassword.value )
    > {
    >

    alert("<%Response.Write(Me.dsRM.Tables(0).Rows.Find(Constants.Strings.Accoun
    tInfoEdit_strPswdConfirmation).ItemArray(1))%>");
    > document.all.AccountAdd_tbxPasswordConf.focus;
    > return false;
    > }
    > /*Check the dropdowns for selections*/
    > else if ( document.all.AccountAdd_ddlQuestion.selectedIndex == 0 )
    > {
    >

    alert("<%Response.Write(Me.dsRM.Tables(0).Rows.Find(Constants.Strings.Accoun
    tInfoEdit_strQuestionError).ItemArray(1))%>");
    > arguments.IsValid = false;
    > }
    > else if ( document.all.AccountAdd_ddlCountry.selectedIndex == 0 )
    > {
    >

    alert("<%Response.Write(Me.dsRM.Tables(0).Rows.Find(Constants.Strings.Accoun
    tInfoEdit_strCountryError).ItemArray(1))%>");
    > arguments.IsValid = false;
    > }
    > else if ( document.all.AccountAdd_PaymentCtl_ddlBillCountry.selectedIndex

    == 0 )
    > {
    >

    alert("<%Response.Write(Me.dsRM.Tables(0).Rows.Find(Constants.Strings.Accoun
    tInfoEdit_strBillCountryError).ItemArray(1))%>");
    > arguments.IsValid = false;
    > }
    > /*Check the amount to pay or the promocode*/
    > else if ( document.all.AccountAdd_PaymentCaptureCtl_tbxPromoCode.value ==

    "" &&
    > document.all.AccountAdd_PaymentCaptureCtl_ddlAmount.selectedIndex == 0)
    > {
    >

    alert("<%Response.Write(Me.dsRM.Tables(0).Rows.Find(Constants.Strings.Accoun
    tNew_strAmountOrPromo).ItemArray(1))%>");
    > arguments.IsValid = false;
    > }
    > }
    >
    > It basically checks the information contained in the page's textboxes and

    dropdowns
    > to ask for required fields or selections.
    >
    > I would appreciate any help.
    >
    > --------------------------------
    > From: Carlos Esparza
    >
    > -----------------------
    > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    >
    > <Id>m1JCv7Bhzk+b14+j8b287A==</Id>
     
    Peter Blum, Aug 30, 2004
    #1
    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. Matt
    Replies:
    14
    Views:
    4,108
    Chad Z. Hower aka Kudzu
    Jan 30, 2004
  2. Hermit Dave
    Replies:
    0
    Views:
    390
    Hermit Dave
    Aug 28, 2004
  3. =?Utf-8?B?dmlkeWE=?=
    Replies:
    1
    Views:
    754
    Kevin Spencer
    Jun 2, 2005
  4. Boss302
    Replies:
    0
    Views:
    1,055
    Boss302
    Nov 21, 2006
  5. Bogdan
    Replies:
    2
    Views:
    655
    Bogdan
    Jun 9, 2008
Loading...

Share This Page