To send a message follow the next steps: Add the reference: using AjaxControlToolkit; Build the message through an alert using JQuery Use the method RegisterClientScriptBlock The function should look like this: StringBuilder sb = new StringBuilder(); sb.Append("<script type=\"text/javascript\">alert('"); sb.Append(mensaje.Replace("'", "")); sb.Append("'); "); sb.Append("window.location.href='"); sb.Append(url); sb.Append("';</script>"); ToolkitScriptManager.RegisterClientScriptBlock(this, typeof(Button), "Mensaje", sb.ToString(), false);