title: Redirect URI cannot contain newline characters.(Query String)
body: <p>I got this error <strong>Redirect URI cannot contain new-line characters.</strong> when run this below code. Am Working <code>MVC 4</code> .  hers is my working code .</p>
  
  <pre><code> protected void Application_Error(Object sender, System.EventArgs e)
              {
                  System.Web.HttpContext context = HttpContext.Current;
                  System.Exception exception = Context.Server.GetLastError();
                  var stackTraceExcep = new StackTrace(exception, true); // create the stack trace
                  var stackTrace = stackTraceExcep.GetFrames()         // get the frames
                                .Select(frame =&gt; new
                                {                   // get the info
                                    FileName = frame.GetFileName(),
                                    LineNumber = frame.GetFileLineNumber(),
                                    ColumnNumber = frame.GetFileColumnNumber(),
                                    Method = frame.GetMethod(),
                                    Class = frame.GetMethod().DeclaringType,
                                }).FirstOrDefault();
  
  
                  string FileName = stackTrace.FileName;
                  string LineNumber = stackTrace.LineNumber;
                  string ColumnNumber = stackTrace.ColumnNumber;
                  string MethodName = stackTrace.Method.Name;
                  string ClassName = stackTrace.Class.Name;
                  if (!string.IsNullOrEmpty(exception.Message))
                  {
                      Response.Redirect(String.Format("~/Error/{0}/?errorMessage={1},FileName={2},LineNumber={3},ColumnNumber={4},MethodName={5},ClassName={6}", "App_Error", exception.Message, FileName, LineNumber, ColumnNumber, MethodName, ClassName));//I got this error in this line 
                  }
                  context.Server.ClearError();
              }
  </code></pre>
  
  <p>What Problem ? How can we solve this ? i have already searched and tried  Google and get some stack overflow answers. but anything does not help me . </p>
  
  <p>Now what i do ?</p>
  
  <p>My Controller action method</p>
  
  <pre><code>[HttpGet]
          public ActionResult App_Error(string errorMessage, string fileName, string lineNumber, string columnNumber, string methodName, string className)
          {
              string errorNumber = Convert.ToString(errorRepository.AddError(errorMessage, fileName, Convert.ToInt32(lineNumber), Convert.ToInt32(columnNumber), methodName, className));
              ViewData["message"] = "An error has occurred in the application . The error number is : " + errorNumber;
              return View();
          }
  </code></pre>