Professional Documents
Culture Documents
New Sudhakar Sharma (MVC 6)
New Sudhakar Sharma (MVC 6)
Qftem. Name éttdy
ZtA> @ teem. Price Zttal >
Ztd> @ Html. Action Link ("Detalles Detafls’
y ce Dew ide teen PreduetTO}) sites
Z|table >
Oda of view for Decinfls Bction
Nome : Detafls
Teropiate: Empty
Model Class; Predetct (Hociets)
Detatis. eshtrol
cede!
“@rnakl Ertiey Mue. Models, Prodan
cho> Rekeets Debafts clhe>
etable bere "1">
ets
Ltd >Preduet id clted>
Ape > @Medet.Pradusk2D ibd >cs
2 tds Preduet Name cltds
tad @Medel Name c |tdy
cites
cys
cas Peduct Déce clta>
Zidd @ Medel.Prtce cltay
Zit
citable S
Zibr>
@ Him actton Lick ( “Gato Incew"s ugnden'')
> Click om 5
Note! Set database Jotifaitze te define the strategy
~ Ge to Glebal-asox
— Wite-tne tonewiry fo Appifeartion-Stoxte >
Dato base. SetJoftiatiter Reducts Gntrottey > Cou;
av Fite Resutt |
t repacionts
fete content to te respons] Tf browser Es
a base class that fs usecl to send
bhaxey
suppovted with MIME Types then fk can vead ov downland
ane file
Syneax!
public fiteResutt Qctianc D
t gape Tepe"
Vetann File CU Path’ “MIME Type ds
ex! pubttc FileResutk Action >
von Five (hv| Context \asp.pa ft ‘opplfcation | pdf),
‘JeorResutt !
Te vepaesents 9 base class “that fs used to seo
Uscn -formattels Gontent to response. dt woillt Seffattie the.
Content aod make tt avaflable offtihe.
© Syntax:
pubttc FeowResulhs } Sctionc 3)
WetuAn YsonColect , Aen LeqnthB elraistour. HrowGet’),
i
Ex:
public FroResuik Uses (>
< Légb< stitaq>C>
Leste seving> ses =meto
x
“Rabel 5
& Daniel’,
* Yobn’
5
yetoan Fson (users, Kok
‘
RedivectResuth:
Tk conticls the precesssng of appifectiions actions
by vedirecttng to speed Ure, db cap be Used) within
ey bleo applicakfeny.
Syntaxt
public RedtvectReeue ectionc >
equast Behaviour. ChowGet) 5
xetann Redivect ("Utd"),©! public. Recttract Resist Pspret ¢ >
a
return Reativectt “http asp. net lwneat “)
5
3
Rectivec! To Route Resutt,
tevepresents a resuth tak performs o veclicection
by useng the specified Route values. dé can be usect to
Yeclreck te any asntrotter action wethin the application
Serex'
publec RediveckToRouteReauit Ectiond >
{
retian RecliectTo@crton ( ActtonNome", “CostoltedNon’),
ex
public Redirect ToReuteResutt Procdercts hist)
£
rete Redteerioctton CH Indes" “Produces;
%
ContenrResult?
Ab yveprescots o weet detined content type “hse és
Sentas vesponse to the cléent, ft alse can aetine the
contest type ond fs encoding
Syntax
Pubic Content Resutk Sctfarc>
vetuan Content (4 String 4 eM IME Type coco dg) 5
Gti pultic ContentResull Sareplecy
Yetutn Content (“Producks"; applicotton| aml, utt-s>,
%Vevascsptbesutt:
te ve presents a bose class that sents Jeu .
Contant to Fespenas: Youncan cat.any Java Scspe function,
oO use a davoSetpr Sbjeck to Send as a vesponse.
Syptas!
putic JavaccApeResutk Actionc >
Yetunn tava eRpL function) 5
%
Expry Resute :
Te vepresents a resutt that Teturn bething- So fe colt
Pot have any veto vale: Nou cam use Such vesutts £0
aeess from ad anesthey action
Note?
Fu action methods 5 a aonhotter ean be frroked
Atectty by UF vequatt. Imarcter to Maik te oF TestHet Br
ts accessbfltty you have to use the exttifbute ” Noniictfim”
Gre}
CNem@Q ction >
pubtie string hetloc >
YetUAD 4 tHetta Word a
%
public \iecoReault dndexe>
ViewBag- sq = bette oy;
Yeruan Vier )5
%
Index. esbten)
@ ViewRagemsg < yin}Yee CRUD eprentions using scafbid templates fo MVc
BO and 3 layer orcltbecteve
Skepti Design yee detabose
— Create a pew database in sab Seven by name
\ Products?
~ Qdd a seo toble by name “tbiPoducts
Product ID Pk Identity) ‘Trt
Name Narchar
Pktce Money
_ Create Stored Receduves
Procedewer Scion
PGetPredactsS — Petarn att products
ePacdaProductso” dnsext a. pew product
spUpdate Poder Update proclact by tes Cl
epdetetePraduct &
Step-2* Rentgo ppiication
Data @acess Layer
Delete predact by tts Td
— Go to file menu add—bNew prajeck
~ Getect "clase Library Preject™
— Name teas “Dataeceess Layex®
— Ureport the Reference
“ System Configusiation"
~ @rll a new class fite by Came “Products!
public class Roduct
pedic tor AetuceDs Lyets sek}
pubic sting Newme €qets sek;
public decimal) Pice facet
3 Set52
q6. @da another class -fite ae mame “ Prodeckcpud.cst
using System Dota;
using System. Bata. Sql Chrent;.
using System- Corfe uratton;
namespace Data @resslayer
pablic class Prodesctopud
& sing gtieen> CoofiquratiorMarager »CommectionString.
PPreducts Commection''] sTostringl 7
SaiCormection com;
Sq\Qonmana ermds
HWReaa Operation
pobsic Penumecabre You might also like
|