GridView内部的控件无法访问后面的代码

时间:2015-06-12 07:15:06

标签: asp.net webforms

GridView内有RadioButtonList 但是,在后面的代码中,我无法访问GridView,但我可以访问<body> <form id="form1" runat="server"> <asp:GridView ID="gvQuestion" runat="server" AutoGenerateColumns="false" DataKeyNames="Id" OnRowDataBound="gvQuestion_RowDataBound"> <Columns> <asp:TemplateField runat="server"> <ItemTemplate> <asp:Label ID="lblQuestion" runat="server" Text='<%# Eval("Question")%>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:RadioButtonList ID="rblOptions" runat="server"></asp:RadioButtonList> </EditItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </form> 控件。
这是html标记

class Example{
public:
    void init();
    void sortByMarks();

private:
    struct Students{
        int ids;
        int marks;
    };
    std::vector < Students > students;

};

void Example::sortByMarks(){
    std::sort(students.begin(), students.end(), [](Students a, Students b){
        return a.marks < b.marks;
    });
}


int main(){
    Example e;
    e.sortByMarks();
}


0 个答案:

没有答案