In my application I am firing javascript alerts with Sweet Alerts from VB.Net code behind, on various page loads and events. I can get the basic alert firing no problem as shown below:
Dim script As String = String.Format("swal('Welcome , " + Username + "');")
ScriptManager.RegisterClientScriptBlock(Page, GetType(System.Web.UI.Page), "redirect", script, True)
There are other alerts available, which involve adding an object inside the quotes of the alert:
swal({
title: "Sweet!",
text: "Here's a custom image.",
imageUrl: "images/thumbs-up.jpg"
});
So my question is, when i want to use this in my code behind, im having trouble knowing where to add quotes in the right places, the object seems to cause a syntax error
Dim script As String = String.Formatswal({ title: "Sweet!", text: "Here's a custom image.", imageUrl: "images/thumbs-up.jpg" });
ScriptManager.RegisterClientScriptBlock(Page, GetType(System.Web.UI.Page), "redirect", script, True)
