ItemTag validation (_tkn_18): Reference token (buttonXXX_ClientInit) was not found.

Page 1 of 2 12 LastLast
  1. #1

    ItemTag validation (_tkn_18): Reference token (buttonXXX_ClientInit) was not found.

    I m creating dynamic controls in my page due to which on my button click , m getting this error.. Please need urgent help..
    ItemTag validation (_tkn_18): Reference token (buttonXXX_ClientInit) was not found.
  2. #2
    Hi @AshwiniRane,

    I guess you use DirectEvents of a dynamically created controls. During its execution a DirectEvent requires a control instance on server. So, to be able to use a DirectEvent is such the scenario you should recreate the controls.

    As an alternative, you can use a combination of a client side listener and a DirectMethod. In this way you will be able to hip the server, but you won't be obligated to recreated the controls.
  3. #3
    Thanks you so much for a quick turnaround.. But can you explain it in brief?? Should I replace DirectEvents with DirectMethods? Will that work when I m clicking on my dynamic button?
  4. #4
    Yes, DirectMethods may be a better option if you are dynamically creating controls.

    DirectEvents require the Control to be recreated upon each request (ASP.NET requirement), but a DirectMethod has a little more flexibility.

    Hope this helps.
    Geoffrey McGill
    Founder
  5. #5
    If I m using Direct Methods.. It is still giving the same error.. M really struggling with this since very long.. Please need help.
    Last edited by geoffrey.mcgill; Jun 24, 2014 at 6:45 AM.
  6. #6
    I have attached my sample code below.

    Ext.Net.Button submm = new Ext.Net.Button();
                                                if (item2.Attributes["ID"].Value == Convert.ToString(Session["SubMenuID"]))
                                                {
                                                    submm.Style.Add("background", "#416da3");
                                                    // submm.Cls = "my-style";
                                                }
                                                submm.Text = item2.Attributes["Text"].Value;
                                                submm.ID = "btn" + item2.Attributes["Text"].Value;
                                                Ext.Net.Parameter grantType11 = new Ext.Net.Parameter();
                                                grantType11.Value = item2.Attributes["href"].Value;
                                                grantType11.Name = "granturl";
                                                //submm.DirectEvents.Click.ExtraParams.Add(grantType11);
                                                //submm.DirectEvents.Click.Event += Get_Menu;
    
                                                submm.Listeners.Click.Fn = "Ext.net.DirectMethods.Get_Menu(" + grantType11 + ")";
    
                                                tree.Items.Add(submm);
    
    
    
     public void Get_Menu(string url)
        {          
                X.Redirect(url);
        }
    Last edited by geoffrey.mcgill; Jun 24, 2014 at 6:44 AM. Reason: Please use [CODE] tags
  7. #7
    Please check this error.. Click image for larger version. 

Name:	Untitled.jpg 
Views:	89 
Size:	93.0 KB 
ID:	13001
  8. #8
    The code sample you have posted appears to be correct.
    Geoffrey McGill
    Founder
  9. #9
    Please help me to solve this error.. M unable to proceed.
  10. #10
    M creating dynamic panel with accordion layout in page.. for which I m appending these dynamic buttons.. If u see, my panel and my buttons are dynamic and I m rendering them to a static FormPanel defining it as Layout = "AccordionLayout". Is this the area of problem?? I need to track this as soon as possible.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 4
    Last Post: Dec 13, 2013, 7:49 PM
  2. Replies: 13
    Last Post: Nov 22, 2013, 10:30 AM
  3. [CLOSED] Reference token (ext.net.initscriptfiles) was not found.
    By jesperhp in forum 2.x Legacy Premium Help
    Replies: 14
    Last Post: Oct 08, 2013, 10:24 AM
  4. Replies: 5
    Last Post: Jun 11, 2013, 7:46 AM
  5. Replies: 3
    Last Post: Jul 11, 2011, 9:43 AM

Posting Permissions