Client side validations still causes postbacks?

Discussion in 'ASP.NET / ASP.NET Core' started by trondb, Oct 31, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I am using standard ASP.NET client side validations such as a RequiredFieldValidators.

    If I click a button - the page will display the validation error, but then as soon as I click the 'ok' buttonfor the JS popup, it STILL causes the page to PostBack and reload.

    This problem only happens for the pageswhen they run off theDiscountASP.NET server. It does not happen on my developer machine, and I have never seen this behaviour in any environment.

    Anybody else have the same problem? Any feedback/suggestions would be highly appreciated!!!!

    Thanks,

    Trond
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    i think there is an attribute on the control for you to control whether you want the validation to be handled on the server or client.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Yes- there is, and it is set to EnablieClientScript = true. This works fine on the development computer, but for some reason it does not work after being uploaded to discountasp.

    I believe it is a security setting on the server causing this, because the error only occurs for pages using AvtiveX controls...

    T
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    I created a simple test page and confirmed that clientside validation works on our server. I am not sure what can be the cause of it.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. Thanks for looking into it Bruce - It appears that I was attaching a javascript to the buttons causing validations(a javascript that prevents users from doubleclicking submit buttons). When I removed it, the validation controls started working again.

    Still, I find it weird that it behaves differently on my development environment compared to discountasp.net. I am guessing different versions of the .NET framework on IIS might be the cause, as I am running 2.0. Do you know what version of the .NET framework is attached to IIS on the servers, or where I could look to find it out? The reason I'm asking is so that I can have my development environment as similar to the web server as possible.

    Thanks again,

    Trond
     
  6. Good idea:) thanks, Bruce!
     
  7. Bruce

    Bruce DiscountASP.NET Staff

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page