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 + '';
    window.open(url, '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.

    Thanks,
    Ashutosh Jha
    http://tricksroad.com

  • #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
    Hello,

    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.

    --------------------------------
    Thanks,
    ARIJIT DAS.

  • #748495
    Hey,

    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-

    http://en.wikipedia.org/wiki/ROT13

    You can also do this using RSA like-

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

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

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

    Thanks,
    Ashutosh Jha
    http://tricksroad.com

  • #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

    codeproject.com/Articles/641758/An-Example-of-URL-Rewriting-With-ASP-NET

    c-sharpcorner.com/UploadFile/akkiraju/url-rewriting-in-Asp-Net/

    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

    Server.Transfer("default1.aspx?id=7")

    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
    http://www.codeproject.com/Articles/2538/URL-Rewriting-with-ASP-NET
    http://weblogs.asp.net/scottgu/tip-trick-url-rewriting-with-asp-net

    Thanks
    Koolprasd2003
    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

    window.open(url.replace('?caseid=' + caseidtmp + '',''), 'new', settings);

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

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

    Thanks
    Umesh Bhosale


  • Sign In to post your comments