试题详情
单项选择题 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(); } }

  • B
  • 关注下方微信公众号,在线模考后查看

热门试题