Check out example codes for "How to execute script in C#". It will help you in understanding the concepts better.

Code Example 1

By LOVE

int NumberOfRows = oRSEntities.Menu_Item.Count();
string message = $" {NumberOfRows} Records saved successfully.";
string script = "window.onload = function(){ swal('";
script += message;
script += "')};";
ClientScript.RegisterStartupScript(this.GetType(), "SuccessMessage", script, true);

Learn ReactJs, React Native from akashmittal.com