多做题,通过考试没问题!

微软认证考试

睦霖题库>其他计算机考试>微软认证考试

You create a Web Form. The Web Form uses the FormView control to enable a user to edit a record in the database. When the user clicks the Update button on the FormView control, the application must validate that the user has entered data in all of the fields. You need to ensure that the Web Form does not update if the user has not entered data in all of the fields. Which code segment should you use? ()

  • A、protectedvoidFormView1_ItemUpdating(objectsender,FormViewUpdateEventArgse){foreach(DictionaryEntryentryine.Keys){if(entry.Value.ToString()==System.String.Empty){e.Cancel=true;return;}}}
  • B、protectedvoidFormView1_ItemUpdated(objectsender,FormViewUpdateEventArgse){foreach(DictionaryEntryentryine.NewKeys){if(entry.Value.Equals(“”)){e.KeepEditMode=true;return;}}}
  • C、protectedvoidFormView1_ItemUpdating(objectsender,FormViewUpdateEventArgse){foreach(DictionaryEntryentryine.NewValues){if(entry.Value.Equals(“”)){e.Cancel=true;return;}}}
  • D、protectedvoidFormView1_ItemUpdating(objectsender,FormViewUpdateEventArgse){foreach(DictionaryEntryentryine.Keys){if(entry.Value.ToString()==System.String.Empty){e.KeepInEditMode=true;return;}}}
正确答案:C
答案解析:
进入题库查看解析

微信扫一扫手机做题