Miguel Flores Miguel Flores - 1 year ago 216
C# Question

How to use Bootbox.alert in C# code

I'm using Bootbox.js instead of js default alerts, all it's ok but I have an .aspx page with pure C# code and I need to show notifications, at the moment I only have a working code for default alert, here is the example:

ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('MyAlertHere.');", true);

My question is, can I be able to use Bootbox alert directly from C# code? How can I do that? Thanks in advance.

Answer Source

You only need to change alert() to bootbox.alert() so your final code should be like this:

ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "bootbox.alert('Your Alert Here');", true);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download