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

  • Home
  • SEARCH
  • 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 7830677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:21:06+00:00 2026-06-02T11:21:06+00:00

I am using this encoding/decoding javascript 64bit from here http://www.webtoolkit.info/javascript-base64.html so here is the

  • 0

I am using this encoding/decoding javascript 64bit from here http://www.webtoolkit.info/javascript-base64.html

so here is the scanrio: from JavaScript i am redireting to a new aspx page and on the page_load i am reading the QueryString id.

Everything working fine but the question is, if i want to encode/decode in asp.net in codebehind how would i do?

i am planning to encode before i redirect to a page from .JS but how would i read the encoded in asp.net code behind?

  • 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-02T11:21:08+00:00Added an answer on June 2, 2026 at 11:21 am

    Everything working fine but the question is, if i want to
    encode/decode in asp.net in codebehind how would i do?

    use below methods in code behind to encode and decode.

    static public string DecodeFrom64(string encodedData)
    {
        byte[] encodedDataAsBytes
            = System.Convert.FromBase64String(encodedData);
        string returnValue =
            System.Text.ASCIIEncoding.ASCII.GetString(encodedDataAsBytes);
        return returnValue;
    }
    
    static public string EncodeTo64(string toEncode)
    {
        byte[] toEncodeAsBytes
                = System.Text.ASCIIEncoding.ASCII.GetBytes(toEncode);
        string returnValue
                = System.Convert.ToBase64String(toEncodeAsBytes);
        return returnValue;
    }
    

    i am planning to encode before i redirect to a page from .JS but how
    would i read the encoded in asp.net code behind?

    you can call DecodeFrom64 method to decode encoded text using JS.

    Test :

     input = "Abu Hamzah"
     JS encoded text = "QWJ1IEhhbXphaA=="
    

    DecodeFrom64("QWJ1IEhhbXphaA==") result is "Abu Hamzah" and EncodeTo64("Abu Hamzah") result is "QWJ1IEhhbXphaA==" as expected.

    Edit:

    Add base64 encode decode java script

    <script type="text/javascript" src="/js/webtoolkit.base64.js">
    

    you can download it from here http://www.webtoolkit.info/djs/webtoolkit.base64.js

    in your javascript you can call this method as below

    window.location.href="mypage.aspx?id=" + Base64.encode('Test');
    

    if you want to decode this query string parameter from server side, then you can use DecodeFrom64 method

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

Sidebar

Related Questions

The IETF recommends using base64 encoding for binary cookie values: https://datatracker.ietf.org/doc/html/draft-ietf-httpstate-cookie-07 So I use
Aside from using a hardware video encoding/decoding device, is there an easy was to
I am doing encoding and decoding using reflection. when I read the this.GetType().Getfields(), in
I have this issue. I have tried everything. ValidateRequest=false.. and decoding and encoding html..
This is a general question about character encoding when using MD5 libraries in various
Using this jquery code: <a href=javascript:void(0) id=m1>Get Selected id's</a> jQuery(#m1).click( function() { var s;
Using this code var html='<div class=somediv></div>'; var target=document.getElementById('contentArea'); target.appendChild(html); I'm getting Uncaught Error: NOT_FOUND_ERR:
I encoded a text in a TMemo using base64 encoding tools ( like Indy
Iam using base64 encoding for authentication to contact a dot net server and for
I'm decoding an encoded path and using this decoded path to draw a polyline

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.