Ramco Ramco

Ramco Ramco

  • 463
  • 2.9k
  • 406.3k

Message not getting displayed

Apr 4 2023 9:22 AM

Hi

  I have below code but message is not getting displayed. I am trying to insert new line after each record

StringBuilder sb = new StringBuilder();
                        foreach (var colum in Result)
                        {
                            sb.Append(" " + sr + ". " + colum.Name + " in Session : " + colum.SessionDeliveryNo + " dated : " + Convert.ToDateTime(colum.SessionDate).ToString("dd-MM-yyyy"));
                            sb.Append("\n");
                            sr++;
                        }
                        string s = sb.ToString();
                        s = s.Replace("'", "").Replace("/", " ").Replace(";", " ").Replace(":", " ").Replace(",", " ");
                        s= System.Text.RegularExpressions.Regex.Replace(s, @"\t|\r", " ");
                        if (Utility.IE(Request.Browser.Browser))
                        {
                            MessageBox.Show(s);
                        }
                        else
                        {
                            ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup('" + "Book has been read by : " + "', '" + s + "','" + "info" + "');", true);
                        }


function ShowPopup(heading, body, type) {
        swalInit.fire({
            title: heading,
            text: body,
            type: type,
            position: 'top',
            allowOutsideClick: false,
            timer: 6000
        });
    }

Thanks


Answers (2)