Saturday, 2 October 2021

how to create toastr alert message in asp.net c#|❤️ bootstrap alert message๐Ÿ”ฅ#asp.net๐Ÿ‘Œ #IMS Session-5๐Ÿ”ฅ

  Overview:

This article explains how to show toastr alert message in role master page in it management system.  we have started a new project for learning asp.net. The project name is IT Management System and given Youtube link IT Management System (IMS Session-5) The following steps here.๐Ÿ‘‡๐Ÿ”ฅ

         

         Download Project Code IMS Session-5


  Step 1:

                  ✍ Open Already Created IT Management System Project Folder Location

                 ✍ It's open in visual studio 


 

open project location

Figure-1 ๐Ÿ‘†
    

  Step 2:  Add Links in Header tag


   <script type="text/javascript" src="//cdn.jsdelivr.net/jquery/1/jquery.min.js"></script>

 <link media="screen" rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.css" />

    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.0.1/js/toastr.js"></script>


  <script type="text/javascript">

      function success(msg) {

          toastr.option = {

              "debug": false,

              "positionClass": "toast-top-center",

              "Onclick":null

          }

          toastr.success(msg, "Success");

          return false;

      }


  </script>



Step 3:  Write C# code in role master page in asp.net C#


 protected void btnSave_Click(object sender, EventArgs e)

        {

            int affect = 0;

            try

            {

                adminBO.Role = txtboxrole.Text;

                adminBO.Description = txtboxDescription.Text;

                affect = objadminbal.InsertRole(adminBO);

                if(affect > 0)

                {

                  

                  ScriptManager.RegisterStartupScript(this,typeof(Page),"Success","<script>success('Role is saved Successfully.!')</script>",false);

                

                }


            }

            catch(Exception ex)

            {

                throw new Exception(ex.Message);

            }


Step 4:  Run the project


Final Output: 

toastr alert message in asp.net c#


More Details:  

            IMS -Session-5 video





Thank you for reading my articles any comments post below. ๐Ÿ‘‡๐Ÿ‘‡๐Ÿ’“๐Ÿ’“ Thank you..!!๐Ÿ‘๐Ÿ‘Œ๐Ÿ‘†๐Ÿ™๐Ÿ™



No comments:

Post a Comment

Angular Course Class Day-4 in English

  Angular Course Class Day-4 Note: You have to add following code your project and run check the result. Angular Material UI Design: CSS...