单项选择题
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(); } }
单项选择题 YouareimplementinganASP.NETpageinane-commerceapplication.CodeinabtnAddToCart_Clickeventhandleraddsaproducttotheshoppingcart.Thepageshouldcheckthestatusoftheshoppingcartandalwaysshowacarticonwhenoneormoreitemsareintheshoppingcart.Thepageshouldhidetheiconwhentheshoppingcarthasnoitems.Youneedtoaddaneventhandlertoimplementthisrequirement.Whicheventhandlershouldyouadd?()
单项选择题 YouareimplementinganASP.NETWebsitethatwillbeaccessedbyaninternationalaudience.Thesitecontainsglobalandlocalresourcesfordisplayelementsthatmustbetranslatedintothelanguagethatisselectedbytheuser.YouneedtoensurethattheLabelcontrolnamedlblCompanydisplaystextintheuser’sselectedlanguagefromtheglobalresourcefile.Whichcontrolmarkupshouldyouuse?()
单项选择题 YouaretestinganexistingASP.NETpage.Thepageincludesatextbox.YouareabletoexecutemaliciousJavaScriptcodebytypingitinthetextboxandsubmitting.YouneedtoconfigurethepagetopreventJavaScriptcodefrombeingsubmittedbythetextbox.Inthe@Pagedirective,whichattributeshouldyousettotrue?()