Detecting first time

Results 1 to 2 of 2

Thread: Detecting first time

  1. #1
    Ted Harwood Guest

    Default Detecting first time

    We have created a form which allows a user to change their password. The form calls the active server page it is embedded in when the user clicks the submit button. <BR><BR>The problem we have is that since the page calls itself we need to run some code the first time the user enters the page and another set of code (syntax checking on the passwords) after the user has submitted the new password. How do you determine whether this is the first time the page has been loaded?<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Detecting first time

    What I usually do is not check if this is the first time the page is being run, but if this is the second time. I usually add a querystring value to the page so that I can tell if this is an update.<BR><BR>Instead of<BR>&#060;form name="myForm" action="changepassword.asp" method="post"&#062;<BR><BR>I put<BR>&#060;form name="myForm" action="changepassword.asp?update=true" method="post"&#062;<BR><BR>or something such as that.<BR><BR>Then you just check to see if Request.Querystring("update") has been set. If not, this is the first time the page is running.

Posting Permissions

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