Wednesday 9 November 2011

Adding the 'YesNo' MessageBox in the ASP.NetWebApplication

Questions Received:
       How to add the 'YesNo' MessageBox in the ASP.Net WebApplication.

Solution:
       In the 'default.aspx.cs' page,
        private void callMessageBox()
        {
            uscMessageBox.AddMessage("Are you sure that you want update the database?", 
[NameSpace].MessageBox.enmMessageType.Attention, true, true, string.Empty);
        }

        public void MessageAnswered(object sender, [NameSpace].MessageBox.MsgBoxEventArgs e)
        {
            if (e.Answer == [NameSpace].MessageBox.enmAnswer.OK)
            {
            }
            else
            {
            }
        }
      
        In the 'page_load()' method,
             Add, uscMessageBox.MsgBoxAnswered += MessageAnswered; //Event HandlerCaller
       
[Note:] The UpdatePanel will be rendered after the method ends. Parent page control will be lost.
           when the UpdatePanel is displayed.

No comments:

Post a Comment