Cov txheej txheem:

Dab tsi yog cov qauv binders hauv MVC?
Dab tsi yog cov qauv binders hauv MVC?

Video: Dab tsi yog cov qauv binders hauv MVC?

Video: Dab tsi yog cov qauv binders hauv MVC?
Video: Finance with Python! Portfolio Diversification and Risk 2024, Hlis ntuj nqeg
Anonim

Qauv binding yog ib tug mechanism ASP. NET MVC siv los tsim cov khoom parameter uas tau teev tseg hauv cov txheej txheem tswj xyuas. Cov tsis muaj peev xwm ua tau ntawm txhua yam, los ntawm qhov yooj yim mus rau qhov nyuaj. Nws yooj yim ua hauj lwm nrog cov ntaub ntawv xa los ntawm tus browser vim tias cov ntaub ntawv tau raug xa mus rau qhov teev tseg qauv.

Tsis tas li ntawd, qhov kev cai qauv khi hauv MVC yog dab tsi?

Tshooj 1: Qauv Binder hauv ASP. NET MVC MVC siv hom nram qab no rau Qauv khij : Qhov no yog siv los tswj cov kev cai binder rau hom ntaub ntawv tshaj tawm los ntawm cov neeg siv kawg hauv kev pom. DefaultModelBinder chav kawm. o Cov chav kawm no yog siv los qhia qhov browser thov rau cov ntaub ntawv khoom. Cov chav kawm no yog ib qho kev thov ntawm IModelBinder

Tsis tas li ntawd, daim ntawv sau hauv MVC yog dab tsi? Cov Cov ntawv sau chav kawm yuav tau txais qhov tso tawm daim ntawv qhov tseem ceeb nyob rau hauv tus maub los txoj kev txiav txim nyob rau hauv tus yuam sij / nqi khub.

Ntawm no, HTTPHandler yog dab tsi hauv MVC?

HTTPHandler yog qhov kev thov qib qis thiab cov lus teb API hauv ASP. Net rau kev txhaj tshuaj ua ntej kev ua tiav rau cov raj xa dej raws li cov ntaub ntawv txuas ntxiv thiab cov lus qhia. ASP. Net runtime engine xaiv tus neeg ua haujlwm tsim nyog los ua qhov kev thov tuaj raws li cov ntaub ntawv txuas ntxiv ntawm qhov kev thov URL.

Muaj pes tsawg hom kev lees paub muaj nyob hauv MVC?

Peb hom kev lees paub hauv qab no peb tuaj yeem ua hauv ASP. NET MVC lub vev xaib:

  • HTML validation / JavaScript validation.
  • ASP. NET MVC qauv validation.
  • Database validation.

Pom zoo: