title: Calling variable from web.config to code behind
body: <p>I would like to call a "variable" from the web.config to the code behind then a button is clicked and I want the user to be redirected to the link that is on that vaiable.
  I tried it this way:</p>
  
  <p>web.config:</p>
  
  <pre><code>&lt;appSettings&gt;
      &lt;add key ="E-leg" value ="https://google.com"/&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>Code behind(on button click:</p>
  
  <pre><code>    Protected Sub ELegLogin(sender As Object, e As EventArgs)
  
          Dim str As string  = ConfigurationManager.AppSettings["E-leg"].ToString();
  
  'Error: Identifier expected
  
          Response.Redirect(Str)
  
  'Argument not specified for parameter 'Number' of 'Public Function Str(Number As Object) As String
      End Sub
  End Class
  </code></pre>
  
  <p>This doesn't work. I get error "<strong>Identifier expected</strong>" and "<strong>Argument not specified for parameter 'Number' of 'Public Function Str(Number As Object) As String</strong>"</p>
  
  <p>I would appreciate it if someone could help me out</p>