[CLOSED] Dynamic header column component direct event Issue

  1. #1

    [CLOSED] Dynamic header column component direct event Issue

    protected sub Createdynamicheader(Byval sender as object,Byval e as DirectEventArgs)
      
                  
                            
                           Dim Headercolumn1 As New Ext.Net.HeaderColumn
                            Headercolumn1.Cls = "x-small-editor"
                            Dim CmpTriggerField As New Ext.Net.TriggerField
                            CmpTriggerField.ID = "TriggerField1"
                            CmpTriggerField.TriggerIcon = TriggerIcon.Search
                             AddHandler CmpTriggerField.DirectEvents.TriggerClick.Event, New DirectEventHandler(AddressOf FilterGrid)
                            Headercolumn1.Component.Add(CmpTriggerField)
                             Gridpannel1.GetView().HeaderRows(0).Columns.Add(Headercolumn1)
                           Gridpannel1.render()
     
      
      
    End Sub

    When i click on the trigger it gives the following error

    Server Error in '/DocuTracker' Application.
    --------------------------------------------------------------------------------
    
    The control with ID 'TriggerField1' not found 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.Web.HttpException: The control with ID 'TriggerField1' not found
    
    Source Error: 
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
    
    Stack Trace: 
    
    
    [HttpException (0x80004005): The control with ID 'TriggerField1' not found]
       Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument) +1065
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
    Last edited by Daniil; Jun 27, 2011 at 1:03 PM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi,

    Any dynamic ASP.NET control must be recreated for each request to handle events,
    It is ASP.NET requirement
    http://weblogs.asp.net/infinitiesloop/archive/2006/08/25/TRULY-Understanding-Dynamic-Controls-_2800_Part-1_2900_.aspx
    http://forums.asp.net/t/1186195.aspx

    I suggest to use DirectMethod for dynamic controls
  3. #3
    When you say to use DirectMethod for dynamic controls, what, specifically, do you mean?
  4. #4
    Hi @jmcantrell,

    Vladimir meant that DirectMethod doesn't require a control instance like DirectEvent.

    For example, if you need to render a Button dynamically and a server side Click handler, then, commonly, you have two approaches:

    1. A Click DirectEvent + recreating the Button control each request.

    or

    2. A Click listener + a DirectMethod.
  5. #5
    2. A Click listener + a DirectMethod.
    an example of this?

    dynamically created button in dynamically created panel

    my case having
    portal<-real in markups[
    i portal column <- dynamic[
    j portlet <- dynamic[
    k button <-dynamic]
    ]
    ]
    ]
    button event[ show hidden window and pass button.text value to this window];
    I would be so glad i would jump an whole minute in happiness

Similar Threads

  1. [CLOSED] Output Cache issue with Direct Method / Direct Event
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 18
    Last Post: Mar 01, 2013, 5:03 AM
  2. RowDblClick Direct Event Issue
    By sumesh in forum 1.x Help
    Replies: 5
    Last Post: May 01, 2012, 11:15 AM
  3. [CLOSED] Button Issue Direct Event (IE6-IE7-IE8)
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Nov 10, 2011, 6:23 AM
  4. [CLOSED] Problem Creating Dynamic Header column for filter
    By legaldiscovery in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Jun 23, 2011, 6:59 AM
  5. [CLOSED] [1.0] Issue with success property on direct event of textfield
    By bryantharpe in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 07, 2010, 5:06 PM

Tags for this Thread

Posting Permissions