【问题标题】:asp net button in user control not posting back ajax panels [closed]用户控件中的asp net按钮不回发ajax面板[关闭]
【发布时间】:2014-09-13 06:35:27
【问题描述】:

如果是Question

我使用 ajax 更新控件,我需要注意什么?

【问题讨论】:

  • 请张贴您的aspx代码!没有代码就无法提供帮助。我已经有了一些想法,但请分享代码。
  • 有很多代码,我怎样才能把它压缩给你?
  • 只需发布相关代码(Ajax 更新控件和控件的内部内容应该进行回发。如果您确实需要提供所有代码,请使用 pastebin.com)

标签: c# asp.net ajax telerik


【解决方案1】:
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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-03
    • 1970-01-01
    相关资源
    最近更新 更多