Help with Error Handling

Results 1 to 3 of 3

Thread: Help with Error Handling

  1. #1
    Disorder Guest

    Default Help with Error Handling

    Hi, <BR>Ok I have 3 Pages <BR>Page 1 = Terms Of services (Has to Click Accpet to Go to Page 2) <BR>Page 2 = (Has to Have a Valid Student Number And ID Number to go to page 3) <BR>Page 3 = View Details (if no valid student numbber it sends you back to page 2 ) <BR><BR>Page 1 Code<BR>Not Relevent <BR><BR><BR><BR>Page 2 Code <BR><BR>&#060;%<BR>Dim IM_AcceptTos <BR>IM_AcceptTos = (Request.Form("Accept"))<BR>Session("AcceptTos") = IM_AcceptTos<BR>If Session("AcceptTos") &#060;&#062; "True" Then<BR> Response.Redirect("index.asp?Msg=Please Review TOS and Click Accept Before Proceeding")<BR>End If<BR>%&#062;<BR><BR>This Redirects to Page 1 and Displays "MSG" as error <BR><BR>--<BR>Page 3<BR> <BR>&#060;% If Not rsView.EOF Or Not rsView.BOF Then<BR>Response.Redirect("page2.asp?MSG="Invalid Student Number Or Id Number") <BR>End If %&#062;<BR><BR>This redirects if the record set is returned EMPTY and shows page2 with the error "MSG" <BR><BR>but it kicks me back to page1<BR>maybe im doing something wrong ? is there a better way of doing this ?<BR>maybe if i can get the requesting url ? <BR>can ane1 help <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Help with Error Handling

    On page 3 you do...<BR><BR> Response.Redirect("page2.asp?MSG="Invalid Student Number Or Id Number")<BR><BR>And on page 2 you ask...<BR><BR> Dim IM_AcceptTos <BR> IM_AcceptTos = (Request.Form("Accept"))<BR> Session("AcceptTos") = IM_AcceptTos<BR> If Session("AcceptTos") &#060;&#062; "True" Then<BR><BR>So you are setting the value of IM_AcceptTos to the value of null (presumably) and then Setting the value of the Session("AcceptTos") to null also.<BR><BR>Then you say if Session("AcceptTos") &#060;&#062; True (which it won&#039;t by now, will it?) Redirect back to page 1.<BR><BR>Maybe on page 2 you should say...<BR><BR> Dim IM_AcceptTos<BR> If Len(Session("AcceptTos")) = 0 Then<BR> IM_AcceptTos = (Request.Form("Accept"))<BR> Session("AcceptTos") = IM_AcceptTos<BR> End If<BR><BR>I also can&#039;t really get my head around what you are doing on page 3 when you say...<BR><BR> &#060;% If Not rsView.EOF Or Not rsView.BOF Then<BR> Response.Redirect("page2.asp?MSG="Invalid Student Number Or Id Number") <BR> End If %&#062;<BR><BR>You are saying if you are not at the BOF of the recordset *OR* the EOF of the recordset.... which means if NO records are returned then You are at the BOF *OR* EOF.<BR><BR>If think that you mean to say...<BR><BR> &#060;%<BR> If rsView.EOF Then<BR> Response.Redirect .....<BR> End If <BR> %&#062;<BR><BR>You only need to check for EOF because if NONE, ZERO, NIX records are returned then EOF will be True.<BR><BR>

  3. #3
    Disorder Guest

    Default RE: Help with Error Handling

    Thanx ill give it a try

Posting Permissions

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