Hello
Is there a way to programmatically check server-side for an ajaxsetting that may or may not already exist in the AjaxSettings collection for the ajax manager? I thought a function like this one should do it, to create a setting object (='mytestsetting') against which then you could use it as a parameter to match against myajaxmanager.AjaxSettings.Contains(mytestsetting), but should I expect it to recognize that a matching setting with the exact same ajaxified source and updated target already exist?
Public Function CheckForExistingAjaxSetting(ByRef ajaxifiedctrl As Control, ByRef updatedctrl As Control, ByRef rlp As RadAjaxLoadingPanel) As AjaxSetting
Dim setting As New AjaxSetting()
Dim target As AjaxUpdatedControl = Nothing
If Not rlp Is Nothing Then
target = New AjaxUpdatedControl(updatedctrl.UniqueID, rlp.UniqueID)
Else
target = New AjaxUpdatedControl(updatedctrl.UniqueID, Nothing)
End If
setting.UpdatedControls.Add(target)
setting.AjaxControlID = ajaxifiedctrl.UniqueID
Return setting
End Function
somewhere else in server code:
Dim mytestsetting As AjaxSetting = CheckForExistingAjaxSetting(foo, bar, loadingpanel)
If Not (myajaxmanager.AjaxSettings.Contains(mytestsetting)) Then ....
.... add the setting programmatically
End If
Could you say if there is a better way to do this that works?
Thankyou
Is there a way to programmatically check server-side for an ajaxsetting that may or may not already exist in the AjaxSettings collection for the ajax manager? I thought a function like this one should do it, to create a setting object (='mytestsetting') against which then you could use it as a parameter to match against myajaxmanager.AjaxSettings.Contains(mytestsetting), but should I expect it to recognize that a matching setting with the exact same ajaxified source and updated target already exist?
Public Function CheckForExistingAjaxSetting(ByRef ajaxifiedctrl As Control, ByRef updatedctrl As Control, ByRef rlp As RadAjaxLoadingPanel) As AjaxSetting
Dim setting As New AjaxSetting()
Dim target As AjaxUpdatedControl = Nothing
If Not rlp Is Nothing Then
target = New AjaxUpdatedControl(updatedctrl.UniqueID, rlp.UniqueID)
Else
target = New AjaxUpdatedControl(updatedctrl.UniqueID, Nothing)
End If
setting.UpdatedControls.Add(target)
setting.AjaxControlID = ajaxifiedctrl.UniqueID
Return setting
End Function
somewhere else in server code:
Dim mytestsetting As AjaxSetting = CheckForExistingAjaxSetting(foo, bar, loadingpanel)
If Not (myajaxmanager.AjaxSettings.Contains(mytestsetting)) Then ....
.... add the setting programmatically
End If
Could you say if there is a better way to do this that works?
Thankyou