I have this code in the Page.aspx.cs file:
void btnSessionCreate_Click(object sender, EventArgs e) { if (Session["user"] == null) { Session["user"] = Guid.NewGuid().ToString(); Response.Redirect("/"); } else if (Session["user"] != null) { string userBrowser = Request.UserAgent.ToString(); string sessionId = Session["user"].ToString(); Response.Write("<script>alert('" + sessionId + "\r\n" + userBrowser + "');</script>"); } }
The main problem is "\ r \ n" in the Response.Write () method. I wanted to share data with a new line, but I canβt!
If "\ r \ n" does not exist, the script warns well, but if it exists in the code, it does not warn anything and changes to reset its CSS style.
Why?
source share