|
-
Nov 21st, 2002, 08:44 AM
#1
Thread Starter
Addicted Member
Whats wrong with this Code Please
I have a a page with a text box called NumberEntered that goes to NumberEntered.asp.
Can anyone please tell me whats wrong
Heres the code for NumberEntered.asp
---------------------------------------------------------------------------------
<%
Dim NumberEntered
NumberedEntered = Request.Form ("NumberEntered")
If NumberEntered = 1 Then
Goto 1
Else
Goto 2
End If
1:
Response.Write "You Entered <b>1</b>"
2:
Response.Write "You Entered <b>2</b>"
%>
-------------------------------------------------------------------------------
thanks
-
Nov 21st, 2002, 08:56 AM
#2
Could yo ube a bit more specific?
Is the form with the textbox using the POST method
Code:
<%
If clng(Request.Form ("NumberEntered"))=1 Then
Response.Write "You Entered <b>1</b>"
Else
Response.Write "You Entered <b>2</b>"
End if
%>
-
Nov 21st, 2002, 10:47 AM
#3
Thread Starter
Addicted Member
Yes there is a text box with a post method.
thanks
-
Nov 21st, 2002, 10:49 AM
#4
Thread Starter
Addicted Member
Sorry. I should have said that i wanted someone to explain to me the Goto command.
Thanks.
-
Nov 21st, 2002, 11:12 AM
#5
I've never used the goto command in ASP.
It's considered bad practice, because it create speghetti(sp?) code
Stick to "if"s or "select case"s
I take it that if you have a value of 1 then both statements are appearing. yes?
-
Nov 21st, 2002, 11:19 AM
#6
Thread Starter
Addicted Member
No i just get an error.
It doesn't work at all.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|