How to determine if a management or user management interface is available?

I iterate over an array of controls and need to know which end-user controls can (via JavaScript or directly) change the value that is sent back. Where can I find such a list?

So far I have this:

Private Function IsEditableControl(ByVal control As Control) As Boolean
    Return TypeOf control Is IEditableTextControl _
     OrElse TypeOf control Is ICheckBoxControl _
     OrElse GetType(ListControl).IsAssignableFrom(control.GetType()) _
     OrElse GetType(HiddenField).IsAssignableFrom(control.GetType())
End Function
+3
source share
2 answers

I'm sure you only need to know if this control implements IPostBackDataHandler .

Public Shared Function IsControlEditable(ByVal ctrl As Control) As Boolean
    Return TypeOf ctrl Is IPostBackDataHandler
End Function

" , , , , , IPostBackDataHandler. , , , ".

, :

  • CheckBox
  • CheckBoxList
  • DropDownList
  • HtmlInputCheckBox
  • HtmlInputFile
  • HtmlInputHidden
  • HtmlInputImage
  • HtmlInputRadioButton
  • HtmlInputText
  • Html
  • HtmlTextArea
  • ImageButton
  • ListBox
  • RadioButtonList
  • TextBox

IPostBackDataHandler , ( , ) .

+3

, , , . , , ... , ...

0

Source: https://habr.com/ru/post/1777980/


All Articles