问题详情

You are implementing a read-only page that includes the following controls. You disable view state to improve performance. You need to ensure that the page is updated to display the latest data when the user clicks the refresh button. Which code segment should you use?() 


A、protected void Page_PreInit(object sender, EventArgs e) { if (!IsPostBack) { gvCustomers.DataSource = GetCustomers();  gvCustomers.DataBind(); } }

B、protected void Page_Load(object sender, EventArgs e) { gvCustomers.DataSource = GetCustomers(); gvCustomers.DataBind(); }

C、protected void gvCustomers_DataBinding(object sender, EventArgs e) { gvCustomers.DataSource = GetCustomers(); gvCustomers.DataBind(); }

D、protected void Page_PreRender(object sender, EventArgs e) { if (!IsPostBack) { gvCustomers.DataSource = GetCustomers(); gvCustomers.DataBind(); } }

时间:2022-06-17 14:20 关键词: MCTS(70-515)

答案解析

B
相关问题