ASP.NET : Hide Querystring in URL

前端 未结 5 706
夕颜
夕颜 2020-12-20 00:16

I don\'t know if I\'m just being overly hopeful, but is there a way to hide the query string returned in the URL?

The scenario I am in is where I have page1.aspx red

5条回答
  •  不知归路
    2020-12-20 00:56

    It preserves Query String and Form Variables (optionally). It doesn’t show the real URL where it redirects the request in the users web browser. Server.Transfer happens without the browser knowing anything. The browser requests a page, but the server returns the content of another.

    protected void btnServer_Click(object sender, EventArgs e)
    {
        Server.Transfer("~/About.aspx?UserId=2");
    }
    

提交回复
热议问题