用户控件中的asp网按钮没有回发ajax面板

时间:2014-07-22 12:26:48

标签: c# asp.net ajax telerik

如果是Question

我使用ajax更新控件,我必须注意什么?

1 个答案:

答案 0 :(得分:0)

1. Parent Page with Ajax Settings (Rad Grid Light Binding) 
    a. use Load Event and onChange events of controls to determine diffrent scenarious of child controls 
    b. Build User Control each time on its OnInit Event
2. Child User Control (Advance Binding - OnNeedDataSource)
    a. use OnInit Event to create the columns (to deep copy from the temp GridTemplateColumn in ASP.net)
    b. use RadAjaxManagerProxy
        c. OnInit Event (build columns)
            i.   Columns must use ItemTemplate and EditTemplage in the temp GridTemplateColumn with Binding Text='<%# Bind("TimeInterval") %>' 
            ii.  Add all the diffrent controls like checkbox, radnumericbox, radtextbox, datetimepickers, combobox...
            iii. Controls must use events:
                - OnInit 
                    * (set Unique Id's, but Id's must be stored in server object or session variable, becuase it must be the same on each init create)
                    * (set the visibility of the Control you want to use to true and the other to false, thus if this is the dataType and control to use set the visibility to true else false
                - OnDataBinding 
                    * (bind to server object with correct dataField, can get dataField from GridTemplateColumn)
                - OnPreRender 
                    * (set the column and row selectable, this is important if you want to make RadGrid like Excell data input and use the EditTemplate, this is very important for saving of data)
                    - OnTextChange (validation with Session variables)
                - EditItemTemplate contains OnInit and OnTextChange events
                - ItemTemplate contains OnInit and OnDataBinding events and OnPreRender