Dab tsi yog qhov kev lees paub ntawm tus neeg siv khoom hauv MVC?
Dab tsi yog qhov kev lees paub ntawm tus neeg siv khoom hauv MVC?

Video: Dab tsi yog qhov kev lees paub ntawm tus neeg siv khoom hauv MVC?

Video: Dab tsi yog qhov kev lees paub ntawm tus neeg siv khoom hauv MVC?
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla use for? 2024, Kaum ib hlis
Anonim

ASP. NET MVC neeg sab validation yog raws li jQuery kev lees paub plugin. Nws tuaj yeem hais tias MVC tus neeg siv khoom - sab validation yog ib qho kev xav ntawm yuav ua li cas jQuery kev lees paub yuav tsum ua haujlwm hauv ASP. NET MVC qhov project. Txawm li cas los xij, qhov kev siv hauv qab no yog tag nrho raws li jQuery's.

Hais txog qhov no, dab tsi yog tus neeg siv khoom thiab sab server kev lees paub hauv MVC?

Client side validation Vs server sab validation Tus neeg siv nkag kev lees paub coj qhov chaw ntawm Server Side thaum lub sij hawm xa rov qab kev sib tham yog hu Server Side Validation thiab tus neeg siv tswv yim kev lees paub coj qhov chaw ntawm Client Side (web browser) hu ua Client Side Validation.

Ib yam li ntawd, server sab validation hauv MVC yog dab tsi? Kab lus no piav qhia txog lub hauv paus ntawm ASP. NET MVC server - sab validation siv Data Annotation API. Lub ASP. NET MVC Lub moj khaum validates txhua cov ntaub ntawv dhau mus rau tus tswj kev txiav txim uas yog ua. Nws populates ModelState khoom nrog ib qho twg kev lees paub ua tsis tiav uas nws pom thiab dhau qhov khoom ntawd mus rau tus tswj.

Ib yam li ntawd, tus neeg siv khoom sab validation yog dab tsi?

Thaum koj nkag mus rau cov ntaub ntawv, qhov browser thiab / lossis lub vev xaib server yuav xyuas kom pom tias cov ntaub ntawv yog nyob rau hauv qhov tseeb hom thiab nyob rau hauv cov kev txwv los ntawm daim ntawv thov. Kev lees paub ua tiav hauv browser hu ua tus neeg siv khoom - sab validation , thaum kev lees paub ua rau ntawm server hu ua server - sab validation.

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

ob

Pom zoo: