I have very little VB experience, but this is what I see.
Here might be your problem:
Code:
If IsNull(Request.Form("gotoUrl")) And Len(Request.Form("gotoUrl")) > 2 Then
You are checking if gotoUrl is null, then checking if it is greater than 2 characters long. If you don't provide a gotoUrl, the first condition will be true, but then you check if it is greater than 2 characters long, which will be false making it skip the condition where gotoUrl is null. Try taking out:
Code:
And Len(Request.Form("gotoUrl")) > 2
Let us know if that works.