Kuv yuav ua li cas thiaj tsim tau ib feem saib hauv nplooj ntawv layout?
Kuv yuav ua li cas thiaj tsim tau ib feem saib hauv nplooj ntawv layout?

Video: Kuv yuav ua li cas thiaj tsim tau ib feem saib hauv nplooj ntawv layout?

Video: Kuv yuav ua li cas thiaj tsim tau ib feem saib hauv nplooj ntawv layout?
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla use for? 2024, Hlis ntuj nqeg
Anonim

Rau tsim a ib nrab saib , txoj nyem rau ntawm Shared folder -> xaiv Ntxiv -> nyem rau Saib .. Note: Yog a ib nrab saib yuav muab faib ua ntau yam saib ntawm txawv controller folder ces tsim nws nyob rau hauv Shared folder, txwv tsis pub koj ua tau tsim tus ib nrab saib nyob rau hauv tib lub nplaub tshev uas nws yuav siv.

Tsis tas li ntawd, ib feem saib puas tuaj yeem muaj tus qauv?

Ib nrab Saib nyob rau hauv ASP. NET MVC yog txhais tau tias sawv cev "pieces" ntawm nplooj ntawv uas ua tau yuav rendered nyob rau hauv ntau qhov chaw ntawm txawv saib . Lawv tuaj yeem muaj cov qauv khi rau lawv, thiab ua tau yuav siv tau @Html.

Ib tug kuj yuav nug, dab tsi yog ib feem saib hauv MVC nrog piv txwv? Kev saib ib nrab yog tib yam li tus neeg siv tswj hauv Web Form daim ntawv thov hauv Asp. Net. Yog li nws tuaj yeem rov siv tau nrog ntau yam saib hauv MVC . Ib nrab Saib yog tshwj xeeb saib uas ua ib feem ntawm Saib cov ntsiab lus. A) Hauv Kev daws teeb meem Explorer ntawm qhov pom studio, txoj nyem rau ntawm Cov Qauv nplaub tshev, xaiv Ntxiv, thiab tom qab ntawd xaiv Chav.

Ib yam li ntawd, tib neeg nug, qhov kev pom ib nrab yog dab tsi?

Kev saib ib nrab hauv ASP. NET MVC yog tshwj xeeb saib uas renders ib feem ntawm saib cov ntsiab lus. Nws yog ib yam li tus neeg siv tswj ntawm daim ntawv thov web. Ib nrab tuaj yeem rov siv tau ntau yam saib . Nws pab peb kom txo tau cov lej duplication. Hauv lwm lo lus a ib nrab saib pab kom peb render a saib hauv niam txiv saib.

Kuv yuav ua li cas thiaj li pom ib feem los ntawm lwm tus maub los?

Koj ua tau ua a ib nrab saib (uas tuaj yeem sib koom ntawm cov tswj raws li nyob rau hauv (1)) nyob rau hauv lub tam sim no saib siv Html. Ib nrab (). Koj tuaj yeem siv Html. Action() hu ua ib qho kev txiav txim ntawm a txawv maub los thiab ua cov txiaj ntsig hauv qhov tam sim no saib.

Pom zoo: