Aspnet mvc4

284 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
284
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Aspnet mvc4

  1. 1. ASP.NET MVC4 JASON
  2. 2.  當填寫會員表單時,輸入帳號後,並檢查帳號是否已 存在?
  3. 3.  搭配 Jquery Validate
  4. 4.  「Remote」Attribute  Constructors
  5. 5.  使用「Remote」Attribute  Model:
  6. 6.  Implement an action method to support your Remote attribute
  7. 7.  Result:
  8. 8.  假設有個 Model,現在想要把全部欄位都加上 [Required],然後每新增一個Property也加上 [Required],除了手動加上去外,還有其他辦法嗎?
  9. 9.  Inherit DataAnnotationsModelMetadataProvider  Implements the default model metadata provider for ASP.NET MVC.  Override 「 CreateMetadata 」Method.
  10. 10. MetadataProvider
  11. 11. ModelMetaData
  12. 12.  How use?
  13. 13.  某表單輸入後按下 submit 後,在 controller 修改了 model 的值,return view 後,網頁上的 textbox 的值 卻不會改變? submit
  14. 14.  Solution:  Add ModelState.Clear();
  15. 15.  Q&A

×