Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8318113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:50:49+00:00 2026-06-08T21:50:49+00:00

I saw my friend doing some Web Development, and one of his code caught

  • 0

I saw my friend doing some Web Development, and one of his code caught my attention is the Response.Redirect.

What is the use of Home?=, isn’t it the LogIn.aspx is the name of the page how come it’s still redirecting if it has Home?=. Can someone answer this question of mine please, and explain it very well.

String url = "LogIn.aspx?Home?=" + Username;
Response.Redirect(url);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:50:52+00:00Added an answer on June 8, 2026 at 9:50 pm

    Update

    Working from all your comments, the answer is: The query string parameter name (key) is actually "Home?", not just "Home". Details (including why the code generating that is technically incorrect) below.

    how come it’s still redirecting if it has Home?=?

    Because there’s no reason it shouldn’t redirect. Granted the URL is invalid (? is a reserved character, it cannot appear unencoded in the query string, so the second ? in the URL is incorrect), but browsers are pretty content to deal with invalid URLs.

    Separately, unless Username has already been URL-encoded, the URL could have other errors depending on the content of Username. (All query string parameters must be URL-encoded, in .Net you do that with HttpUtility.UrlEncode.)

    Re your comment:

    what i mean is i don’t know why he use Home?= and what is the use of it

    It has no use, it’s an error. He probably just meant (no, apparently not, see below after your next comment)

    String url = "LogIn.aspx?Home=" + Username;
    

    …which would more correctly be:

    String url = "LogIn.aspx?Home=" + HttpUtility.UrlEncode(Username);
    

    (Technically, you have to URL-encode both the keys and values [both "Home" and Username], but the URL-encoded form of "Home" is "Home", so we can get away without making the call for the key. Not true if the key needs to have any of the URL reserved characters in it.)

    Re your further comment consisting entirely of this code:

    string retrieveValue;
    protected void Page_Load(object sender, EventArgs e) {
        this.lblUsername.Text = Request.QueryString["Home?";
        retrieveValue = this.lblUsername.Text;
    }
    

    Assuming the syntax error in the above is fixed (missing ] on line 3), it would appear that he’s actually using "Home?" as a key (parameter name). That means the redirect should be:

    String url = "LogIn.aspx?" + HttpUtility.UrlEncode("Home?") + "=" + HttpUtility.UrlEncode(Username);
    

    …because the key has a reserved character in it (?). Because that will be decoded for you on receipt, that should make the code above work.

    Note that most browsers will probably let you get away with the string as he specified it. It’s incorrect, but in a way browsers probably allow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I saw some code when studying the open source project: here . But I
I saw some html that displays the results of a PHP code just by
I have some code that was working one month ago... now, when I check
Saw the code here . Can any one tell me what it means? Action
My friend saw my code, a part is get a plist data from URL
I saw some websites that (for example): if you want to view your message
I saw many threads with this tittle, but no one really speak about reuse
I saw the following fragment of C code in a text book and it's
I just got a source code file from a friend. The file was created
I recently saw an OO design question on some forum and started thinking of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.