Ramco Ramco

Ramco Ramco

  • 443
  • 3.4k
  • 527.1k

Error - ShowPopup is not defined

Aug 17 2024 4:08 AM

Hi

  In below code i am getting error

ShowMessage("Success", "Record Saved Successfully", "Success");

public void ShowMessage(String Title, String Text, String Type)
{
    Text = Text.Replace("'", "").Replace("/", " ").Replace(";", " ").Replace(":", " ").Replace(",", " ");
    Text = System.Text.RegularExpressions.Regex.Replace(Text, @"\t|\n|\r", " ");
    if (Common.CommonFunction.IE(Request.Browser.Browser))
    {
        Common.MessageBox.Show(Text);
    }
    else
    {
        ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopUp('" + Title + "', '" + Text + "','" + Type + "');", true);
    }
}

private void ShowPopUp()
{
    System.Text.StringBuilder sb = new System.Text.StringBuilder();
    sb.Append(@"<script language='javascript'>");
    sb.Append(@"$('#modal_form_horizontal').modal({backdrop: 'static',keyboard: true, show: true});");
    sb.Append(@"</script>");

    ClientScript.RegisterStartupScript(this.GetType(), "JSScript", sb.ToString());
}

Thanks


Answers (1)