By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

Redirecting user

P: 56
Hello

In the following code to redirect a user after logging on

Expand|Select|Wrap|Line Numbers
  1.   Protected Sub LogonBtn_Click(sender As Object, e As EventArgs) Handles LogonBtn.Click
  2.  
  3.         'Authenticate user
  4.  
  5.         Dim Authenticated As Boolean = Authenticate(strEmailTextBox.Text, passwordTextBox.Text)
  6.  
  7. 'If results found then redirect to the userpage.aspx
  8.  
  9.         If Authenticated Then
  10.  
  11.             Dim target = String.Format("~/userpage.aspx?strEmailValue={0}", strEmailTextBox.Text)
  12.  
  13.             Response.Redirect(target, False)
  14.  
  15.         End If
  16.  
  17.     End Sub
What does

Expand|Select|Wrap|Line Numbers
  1.  Response.Redirect(target, False)
do that

Expand|Select|Wrap|Line Numbers
  1.  Response.Redirect(target, True)
does not do?

Thanks
Jul 12 '16 #1

✓ answered by Luk3r

The Boolean value is simply telling the current page to either stop loading (True) or continue loading (False). The Response.Redirect method contains two possible uses:
Expand|Select|Wrap|Line Numbers
  1. Response.Redirect(url as string)
and
Expand|Select|Wrap|Line Numbers
  1. Response.Redirect(url as string, pageResponse as Boolean)

Share this Question
Share on Google+
2 Replies


100+
P: 299
The Boolean value is simply telling the current page to either stop loading (True) or continue loading (False). The Response.Redirect method contains two possible uses:
Expand|Select|Wrap|Line Numbers
  1. Response.Redirect(url as string)
and
Expand|Select|Wrap|Line Numbers
  1. Response.Redirect(url as string, pageResponse as Boolean)
Jul 12 '16 #2

P: 56
Thanks Luc3R

So I would probably want to choose 'True' as in 'stop loading when you authenticate'?

I have used both

Expand|Select|Wrap|Line Numbers
  1. Response.Redirect(target, False)
Expand|Select|Wrap|Line Numbers
  1. Response.Redirect(target, True)
with a real email and password stored in a database and I have been successfully redirected whichever I used, False or True, so I just wondered.

Thanks again.
Jul 12 '16 #3

Post your reply

Sign in to post your reply or Sign up for a free account.