I am using bootbox.js plugin to show popup but there is one condition where i want to show the modal popup on pageoad event using c#. If i use window.load() event in javascript the modal popup showsup but not throught padgeload method.
I am calling the script using scriptManager,
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
uname = (string)Session["username"];
if (uname != null)
{
ScriptManager.RegisterStartupScript(this.GetType(), "teste", "teste();", true);
}
}
}
And this is the script:
<script type="text/javascript">
function teste() {
event.preventDefault();
bootbox.alert("Hello world!", function () {
});
}
</script>
Any help will be appreciated.