MessageBox

  1. #1

    MessageBox

    Controler Files :

    namespace Aytek.WebLis.Controllers
    {
        [DirectController(AreaName = "MessageBox_Basic")]
        public class LaboratuvarModuluController : Controller
        {
           
            public ActionResult Index()
            {
                return View();
            }
            [DirectMethod(Namespace = "CompanyX")]
            public ActionResult DoConfirm()
            {
                X.Msg.Confirm("Message", "Confirm?", new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        Handler = "CompanyX.MessageBox_Basic.DoYes()",
                        Text = "Yes Please"
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Handler = "CompanyX.MessageBox_Basic.DoNo()",
                        Text = "No Thanks"
                    }
                }).Show();
    
                return this.Direct();
            }
            [DirectMethod(Namespace = "CompanyX")]
            public ActionResult DoYes()
            {
                this.GetCmp<Label>("Label1").Text = "YES";
                return this.Direct();
            }
            [DirectMethod(Namespace = "CompanyX")]
            public ActionResult DoNo()
            {
                this.GetCmp<Label>("Label1").Text = "NO";
                return this.Direct();
            }
        }
    }
    Chtml Files :

    @{
        ViewBag.Title = "Confirm MessageBox with ButtonsConfig - Ext.NET MVC Examples";
        Layout = null;
        var X = Html.X();
    }
        @Html.X().ResourceManager(ViewBag.ManagerConfig as MvcResourceManagerConfig)
            <p>
                @(X.Button()
                    .Text("Confirm")
                    .Width(100)
                    .Height(30)
                    .Icon(Icon.Error)
                    .OnClientClick("CompanyX.MessageBox_Basic.DoConfirm()")
                )
            </p>
    
            <p>
                @(X.Label()
                    .ID("Label1")
                    .Format("You clicked the '<b>{0}</b>' Button.")
                )
            </p>
    When Click Button It never does anything why What is problem ?
    Last edited by Daniil; Oct 13, 2015 at 1:44 PM. Reason: Please use [CODE] tags
  2. #2
    Hi @rushking,

    Please post a screenshot with the project's structure in Visual Studio Solution Explorer.
  3. #3

    ScreenShot

    Add to ScreenShot in attachments
    Attached Thumbnails Click image for larger version. 

Name:	msgBox.png 
Views:	32 
Size:	79.5 KB 
ID:	24277  
  4. #4
    Thank you. So, I don't see you are using Areas in the project.

    Please try replacing
    [DirectController(AreaName = "MessageBox_Basic")]
    with
    [DirectController]
    Also this
    CompanyX.MessageBox_Basic
    with just
    CompanyX
    where you call DirectMethods.
  5. #5

    Solved

    Thank you for your answer was very helpful, thank

Similar Threads

  1. [CLOSED] MessageBox bug
    By Akpenob in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 29, 2013, 12:54 PM
  2. MessageBox Example Not working
    By Tbaseflug in forum 1.x Help
    Replies: 5
    Last Post: Jun 18, 2009, 3:48 PM
  3. MessageBox - Cannot get working from Example
    By Tbaseflug in forum 1.x Help
    Replies: 4
    Last Post: Jun 17, 2009, 5:24 PM
  4. Ext.MessageBox
    By dbassett74 in forum 1.x Help
    Replies: 3
    Last Post: May 26, 2009, 6:13 PM
  5. ExtJS MessageBox
    By jchau in forum 1.x Help
    Replies: 0
    Last Post: Oct 09, 2008, 10:30 AM

Posting Permissions