Results 1 to 10 of 10

Thread: page_isvalid is undefined

  1. #1

    Thread Starter
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    page_isvalid is undefined

    Hi, I have a javascript fucntion that only runs if the page is valid, so in the function I have

    Code:
     if (Page_IsValid == true) {
    
     }
    When debugging locally this is fine, but when on the server I get an undefined error for page_IsValid.

    I did some research and in framework 1 a jscript file was included in the aspnet_client folder that exposed this object, appearently with version 2 and above this is now all wrapped into the framework.

    As I am using 3.5 it should be working, are there any IIS settings I need to make.

    thanks in advance

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: page_isvalid is undefined

    May be you are missing the Javascript file which contains the Page_IsValid function. Check the file
    Please mark you thread resolved using the Thread Tools as shown

  3. #3

    Thread Starter
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    Re: page_isvalid is undefined

    Quote Originally Posted by danasegarane View Post
    May be you are missing the Javascript file which contains the Page_IsValid function. Check the file
    As mentioned in my post I don't think a javascript file is needed past framework 1.

  4. #4
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: page_isvalid is undefined

    I have no idea. Hope some help
    Please mark you thread resolved using the Thread Tools as shown

  5. #5
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: page_isvalid is undefined

    Do you actually have any asp.net validators on your page?

    When you add validators (such as <asp:RequiredFieldValidator />) to your page, all the required script is added by asp.net. So if you inspect your page you should see a section similar to the following:
    Code:
    <script type="text/javascript" src="/TestArea/WebResource.axd?d=1vW1DNui2GcIDk5r6qXmVLWLFw6_x4xP_-ytaaINNjXt29wBlMh1zxk3jG8TBm0zlvAsRVqAxbjQNUxzX13tZMcR0PA1&t=634244866920000000">
    var Page_ValidationVer = "125";
    var Page_IsValid = true;
    var Page_BlockSubmit = false; 
    ...
    This is where Page_IsValid gets defined.

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: page_isvalid is undefined

    In order for the Page_IsValid to be present, then the server needs to have the required JavaScript file available to it. Check the JavaScript files that are being referenced by your page, what are they?

    Gary

  7. #7

    Thread Starter
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    Re: page_isvalid is undefined

    Thanks for the replies all, Ive sorted it now. Was an issue with virtual directory but thanks for the help

  8. #8
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: page_isvalid is undefined

    Glad to hear that you got it working!

    Can you remember to mark your thread as resolved?

    Thanks

    Gary

  9. #9

    Thread Starter
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    Re: page_isvalid is undefined

    I shall make every endeavour to remember in future

  10. #10
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: page_isvalid is undefined

    Quote Originally Posted by davebat View Post
    I shall make every endeavour to remember in future
    thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width