i have a notification j-query plugin .. i taste it in my page (working 100%)
but when i want to use it in a event SqlDataSource1_Deleted with the response.write method it does not work
Protected Sub SqlDataSource1_Deleted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SqlDataSource1.Deleted
Response.Write("<script type='text/javascript'> showNotification({message: 'This is a sample Success notification', type: 'success' }); </script>")
End Sub
If you use
Response.Writein a page, you will be putting the code before the HTML document itself. This means that it will run before jQuery or any plugin is loaded. (And also that it may cause the page to be rendered in quirks mode, which would probably break the entire layout.)Use the
RegisterStartupScriptmethod to add a script in the page: