Bruno Casali
Bruno Casali

Reputation: 1380

How I use the modals bootstrap automatically

Hei, I want know how put in my application the bootstrap modals, but I need it launch them automatically, the objective is show a error message... I throw them on the catch block in ASP .NET(this I can do) ;D Thanks

Upvotes: 0

Views: 108

Answers (2)

drigomed
drigomed

Reputation: 186

You may use the ScriptManager.RegisterStartupScript method, passing the script: $('#myModal').modal('show'). If you are in a partial postback, you should use the RegisterClientScriptBlock instead.

[]s

Upvotes: 1

bbill
bbill

Reputation: 2304

You might have to include some Javascript on the page: if there's an error, show the modal through the Javscript API, as shown in the docs.

if (error) {
  $('#myModal').modal('show');
}

Upvotes: 1

Related Questions