IController Execute Method : Token is not unique error

  1. #1

    IController Execute Method : Token is not unique error

    Hi Friends,

    Ext.net did with the user login page. However, the global.asax file in the user's authority to check and I'm referring to the login page.

    However, I sent it directly to that page in addition to the errors found in the image is showing.

    As response.redirectxxx codes do not work. Routing need to do it this way. Because the discontinuation of operations is important.

    How do I solve the problem?

    Click image for larger version. 

Name:	tokenError.jpg 
Views:	20 
Size:	95.4 KB 
ID:	10781

    I use the routing code

    IController userController = EngineContext.Current.Resolve<Mes.Web.UI.Controllers>;
    var routeData = new RouteData();
    routeData.Values.Add("controller", "User");
    routeData.Values.Add("action", "Login");
    userController.Execute(new RequestContext(new HttpContextWrapper(Context), routeData));
    RAZOR
     @X.ResourceManager()
        @(X.Window()
            .Layout(LayoutType.VBox)
            .LayoutConfig
            (
                new VBoxLayoutConfig
                {
                    Align = VBoxAlign.Center,
                    ConstrainAlign = false
                }
            )
            .Title(T("account.login.title").ToHtmlString())
            .Padding(5)
            .BodyPadding(5)
            .Width(400)
            .Height(180)
            .Modal(true)
            .Closable(false)
            .Draggable(false)
            .Resizable(false)
            .Items
            (
                X.FormPanel()
                    .Border(false)
                    .BodyBorder(0)
                    .BorderSpec("0 0 0 0")
                    .StyleSpec("border:none !important;")
                    .Frame(true)
                    .Margin(0)
                    .Padding(0)
                    .Width(400)
                    .Height(180)
                    .Items
                    (
                            X.ComboBoxFor(x => x.PlantId).Items(Model.Plants),
                            X.TextFieldFor(x => x.Username).Hidden(!Model.UsernamesEnabled),
                            X.TextFieldFor(x => x.Email).Hidden(Model.UsernamesEnabled),
                            X.TextFieldFor(x => x.Password).InputType(Ext.Net.InputType.Password),
                            X.CheckboxFor(x => x.RememberMe),
                            X.Button()
                            .Text(T("account.login.button.text").ToHtmlString())
                                .DirectEvents
                                (
                                    de =>
                                    {
                                        de.Click.Action = Url.Action("Login");
                                        de.Click.EventMask.ShowMask = true;
                                        de.Click.EventMask.Msg = T("Common.Loading").ToHtmlString();
                                    }
                                )
                    )
            )
        )
    Last edited by bilgibilisim; May 12, 2014 at 12:37 PM. Reason: Added Razor Code
  2. #2
    If it is partial view then ResourceManager should not be presented inside such view
  3. #3
    Thanks Vladimir. But, that answer did not solve.

    Login.cshtml Layout is null.

    @model Mes.Web.UI.Models.User.LoginModel
    @using Mes.Core;
    @using Mes.Data.Entities.Common.Plants;
    
    @{
        Layout = null;
        var X = Html.X();
    }
    
    <!DOCTYPE html>
    <html>
    <head>
        <meta name="viewport" content="width=device-width" />
        <title>Aizen @string.Format("v{0}", MesVersion.Version)</title>
        <link href="~/Content/sublayout.css" rel="stylesheet" />
    </head>
    <body>
        @X.ResourceManager()
        @(X.Window()
            .Layout(LayoutType.VBox)
            .LayoutConfig
            (
                new VBoxLayoutConfig
                {
                    Align = VBoxAlign.Center,
                    ConstrainAlign = false
                }
            )
            .Title(T("account.login.title").ToHtmlString())
            .Padding(5)
            .BodyPadding(5)
            .Width(400)
            .Height(180)
            .Modal(true)
            .Closable(false)
            .Draggable(false)
            .Resizable(false)
            .Items
            (
                X.FormPanel()
                    .Border(false)
                    .BodyBorder(0)
                    .BorderSpec("0 0 0 0")
                    .StyleSpec("border:none !important;")
                    .Frame(true)
                    .Margin(0)
                    .Padding(0)
                    .Width(400)
                    .Height(180)
                    .Items
                    (
                            X.ComboBoxFor(x => x.PlantId).Items(Model.Plants),
                            X.TextFieldFor(x => x.Username).Hidden(!Model.UsernamesEnabled),
                            X.TextFieldFor(x => x.Email).Hidden(Model.UsernamesEnabled),
                            X.TextFieldFor(x => x.Password).InputType(Ext.Net.InputType.Password),
                            X.CheckboxFor(x => x.RememberMe),
                            X.Button()
                            .Text(T("account.login.button.text").ToHtmlString())
                                .DirectEvents
                                (
                                    de =>
                                    {
                                        de.Click.Action = Url.Action("Login");
                                        de.Click.EventMask.ShowMask = true;
                                        de.Click.EventMask.Msg = T("Common.Loading").ToHtmlString();
                                    }
                                )
                    )
            )
        )
    </body>
    </html>
    Quote Originally Posted by Vladimir View Post
    If it is partial view then ResourceManager should not be presented inside such view
  4. #4
    How Login action looks?
  5. #5
    Even if only one page ResourceManager I am getting the same error. !

    However, the page also ext.net least something about the error does not happen. ResourceManager that is enough!

    Quote Originally Posted by Vladimir View Post
    How Login action looks?
  6. #6
    We need test case reproduces the issue
    Please provide test sample which doesn't require any changes from our side

Similar Threads

  1. Replies: 0
    Last Post: Jan 24, 2014, 4:57 PM
  2. [CLOSED] Token is not unique error for nested grid
    By alscg in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 01, 2013, 4:53 AM
  3. [OPEN] [#330] A suggestion to eradicate "Token is not unique" errors
    By michaeld in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 28, 2013, 6:01 AM
  4. [CLOSED] Token is not unique
    By SFritsche in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 04, 2013, 8:08 AM
  5. TokenNotUniqueException: Token is not unique
    By sfvaleriano in forum 2.x Help
    Replies: 8
    Last Post: Dec 28, 2012, 7:51 AM

Tags for this Thread

Posting Permissions