How to call a code-behind method from aspx page?

前端 未结 1 1109
北荒
北荒 2020-12-10 13:21

I\'ve an object that contains a field called DevList which is defined like this

public List DevList { get; set; }
1条回答
  •  佛祖请我去吃肉
    2020-12-10 14:02

    Assuming this is how your class looks:

    public class MyItem
    {
        public List DevList { get; set; }
    }
    

    And that

    ds = List();
    

    Do this:

    In your code-behind:

    protected string DisplayListOfDevelopers(object _devList)
    {
        //Cast your dev list into the correct object
    }
    

    In your markup:

    
     
       
       
     
    
    

    Just be sure to make the function in your code-behind is protected or public.

    0 讨论(0)
提交回复
热议问题