title: Asp.Net MVC encrypted querystring
body: <p>I am trying to get an encrypted querystring on a <code>ActionResult</code> but the parameter is always null.</p>
  
  <p>I have implemented an e-mail URL and encrypted some informations like this:</p>
  
  <pre><code>string key = "r0b1nr0y";
  var queryString = EncryptDecryptQueryString.Encrypt(String.Format("testId={0}&amp;otherInfo={1}", Id, otherInfo), key);
  </code></pre>
  
  <p>It is resulting in this URL parameter:</p>
  
  <pre><code>?fpZG2mFDOZbuuBFccKLeu9Rzbn/I05i577IaaMSt0uztuHmWdeVIOQ==
  </code></pre>
  
  <p>And the url is something like this:</p>
  
  <pre><code>www.test.com/MyController/MyAction?fpZG2mFDOZbuuBFccKLeu9Rzbn/I05i577IaaMSt0uztuHmWdeVIOQ==
  </code></pre>
  
  <p>Now, at the controller side, the <code>ActionResult</code> is suppose to receive a string.</p>
  
  <p>Running the program, when i try to test the generated url, the code reach <code>MyAction</code> but the string parameter is always null.</p>
  
  <pre><code>public ActionResult MyAction(string queryString)
  {
       ... Do Stuff here...        
  }
  </code></pre>
  
  <p>I have tried to create a specific route for it as well(<a href="https://stackoverflow.com/questions/21437726/mvc-controller-action-parameter-is-null">like this example</a>), but didn't work.</p>
  
  <pre><code>routes.MapRoute(
              "RouteTest",
              "MyController/MyAction/{queryString}",
              new { controller = "MyController", action = "MyAction", queryString = "" }
          );
  </code></pre>
  
  <p>I can take the whole url with <code>Request.RawUrl</code>, but i really can't understand why the encrypted string parameter is null(or empty).</p>
  
  <p>Have i missed the point somewhere or is there an explanation for the null parameter value?</p>