URI перенаправления не может содержать символы новой строки. Ошибка сервера
Redirect URI cannot contain newline characters. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Redirect URI cannot contain newline characters.
Я получаю эту ошибку ,когда мой файл находится на сервере, в localhost мой код работает нормально. Пожалуйста, предоставьте мне решение для этого
Что я уже пробовал:
protected void btnsave_Click(object sender, EventArgs e) { try { using (SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString)) using (SqlCommand cmm = new SqlCommand()) { cmm.Connection = cnn; cmm.CommandType = CommandType.Text; if (btnsave.Text == "Save") { cmm.CommandText = "INSERT INTO register_user([name],[email],[email_pass],[panel_pass],[dept])" + "VALUES(@name,@email,@email_pass,@panel_pass,@dept)"; cmm.Parameters.AddWithValue("@name", txtname.Text.Trim().ToString()); cmm.Parameters.AddWithValue("@email", txtemail.Text.Trim().ToString()); cmm.Parameters.AddWithValue("@email_pass", txtemailpass.Text.Trim().ToString()); cmm.Parameters.AddWithValue("@panel_pass", txtpass.Text.Trim().ToString()); cmm.Parameters.AddWithValue("@dept", ddldept.Text.Trim().ToString()); } else { cmm.CommandText = "UPDATE [register_user] SET name=@name,email=@email,email_pass=@email_pass,panel_pass=@panel_pass,dept=@dept where id=" + ViewState["id"]; cmm.Parameters.AddWithValue("@name", txtname.Text.Trim().ToString()); cmm.Parameters.AddWithValue("@email", txtemail.Text.Trim().ToString()); cmm.Parameters.AddWithValue("@email_pass", txtemailpass.Text.Trim().ToString()); cmm.Parameters.AddWithValue("@panel_pass", txtpass.Text.Trim().ToString()); cmm.Parameters.AddWithValue("@dept", ddldept.Text.Trim().ToString()); } cmm.Connection.Open(); cmm.ExecuteNonQuery(); cmm.Connection.Close(); ScriptManager.RegisterStartupScript(this, GetType(), "Success", "alert('Information Save Successfully.');", true); gvbind(); clear(); } } catch (Exception ex) { Response.Redirect(ex.Message); } }