Click to See Complete Forum and Search --> : Problem with my page..!!!!help..


Aarthi
05-11-2005, 09:58 AM
Hi folks,

I have 2 pages to add new users and delete existing users. I form the UI for the user addition and deletion separately...i.e UIuseradd.asp and UIuserdel.asp..and then redirect the page to a page called usermanager.asp where i check whether the user exists or not. If the user does'nt exist, I add the new user. Otherwise, i say "user exists".
I do this in an if-else condition in the usermanager.asp. what's happening is that recordcount before addition of a new record(user) is 0.so record is getting added but control is also going to else condition. Therefore, the msg "user exists" also gets printed.

I don't know y this happens..can anyone help me on this?

TheBearMay
05-11-2005, 10:13 AM
Going to have to see a little code before taking a guess.

Aarthi
05-12-2005, 12:55 AM
Hi folks..
attaching the code...

psn
05-14-2005, 05:58 AM
Hi folks..
attaching the code...


In usermanager.asp, there is no proper closing of 'end if'.
Just count the number of 'if' and 'end if'. They does not count equal in number.

Try to use either of the following 'if condition' types.

1)If condition1 then
statement1
Else
If condition2 then
statement2
Else
If condition3 then
statement3
Else
statement4
End If
End If
End If

OR


2)If condition1 then
statement1
ElseIf condition2 then
statement2
ElseIf condition3 then
statement3
Else
statement4

End If

So after modifying this 'if condition', Did your problem of adding users got solved?