You must Sign In to post a response.
  • Category: ASP.NET

    Hide Querystring on page navigation

    Hide querystring parameters on page redirection from clientside to serverside.

    Below is the code used in ClientSide:

    var settings = 'scrollbars=1,toolbar=0,height=' + height;
    settings = settings + ',width=' + width;
    settings = settings + ',top=' + top;
    settings = settings + ',left=' + left;
    var url = 'VAEditCptCode.aspx?caseid=' + caseidtmp + '';, 'new', settings);
  • #748480
    Hi Samaira,

    Its not clear from the post that what you want to ask. Please clarify, if you are getting any error with this code.

    Ashutosh Jha

  • #748481
    I want to Hide querystring parameters on page redirection from javascript to serverside.

    I want the url to appear as Login.aspx instead of Login.aspx/userid=123&loginId=456.

  • #748483

    Hiding query string value is not possible.

    You can encrypt a query string parameter's value using JavaScript when you are sending the query string and then at the page, which will receive the query string value, you can use either JavaScript for decrypt it or ASP.Net to decrypt it.


  • #748495

    I don't think this is possible. You can't hide the query string in the url. Instead you can encrypt the url. For more details, read this article-

    You can also do this using RSA like-

    var provider = new System.Security.Cryptography.RSACryptoServiceProvider();

    var encryptedBytes = provider.Encrypt(
    System.Text.Encoding.UTF8.GetBytes("message"), true);

    string decryptedTest = System.Text.Encoding.UTF8.GetString(
    provider.Decrypt(encryptedBytes, true));

    Ashutosh Jha

  • #748505
    Please use url rewriting to implement this functionality. With Url Rewriting you can have your custom url and define the url as per your requirement. Check the links below to know how to implement urlrewriting

    Miss. Jain
    Microsoft Certified Technology Specialist in .Net

  • #748509
    Server.Transfer is the good way to hide the querystring as it will avoid the round trip so the Queruystring can not be displayed in URL


    or you may use the trick of URL writing that will make your page secure and it will hide your querystring
    see below link for it

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #748608
    you can write like this but you will not get this value in next page'?caseid=' + caseidtmp + '',''), 'new', settings);

    if u want this value you may use session or other things for this I think

  • #748713
    you can try for server.transfer() as it is call form server side

    Umesh Bhosale

  • Sign In to post your comments