澶嶅埗鎴愬姛
  • 鍥炬鑳屾櫙
  • 绾壊鑳屾櫙

绗旇

  • 2019-11-16
    涓哄ぇ浜哄甫鏉ュ舰璞$殑缇婄敓鑲栨晠浜嬫潵鍘 涓哄瀛愬甫鍘诲揩涔愮殑鐢熻倴鍥剧敾鏁呬簨闃呰
    璋堣皥鎬庢牱瀛﹀ソ鏁板_鑻忔闈-涓鐢熸枃搴
lanfenx587..

涓婁紶浜庯細2013-08-20

绮変笣閲忥細40

吉林省快三开奖—官方网址22270.COM璇ユ枃妗h础鐚呭緢蹇欙紝浠涔堜篃娌$暀涓嬨



吉林省快三开奖—官方网址22270.COM鈥擬VC璇存槑鏂囨。

涓嬭浇绉垎锛1600

鍐呭鎻愮ず锛 MVC3 椤圭洰鍒涘缓锛 *.绌烘ā鏉块夐」鍙敓鎴愪竴涓 MVC3 搴旂敤绋嬪簭鎵闇瑕佺殑鏈灏戞枃浠跺拰鏂囦欢澶癸紱 *.Internet 搴旂敤绋嬪簭閫夐」鐢熸垚涓涓皬鍨嬬殑渚嬪瓙搴旂敤绋嬪簭锛 鍙湪鍏朵笂淇敼骞跺缓绔嬪叾瀹冨姛鑳斤紱 瀹冨寘鎷簡鐢ㄦ埛娉ㄥ唽涓庤璇併 瀵艰埅浠ュ強涓涓崗璋冪殑瑙嗚鏍峰紡锛 *.internet 搴旂敤绋嬪簭鏇村皬浜涳紝 浣嗗畠鏄璁$敤浜庨氳繃涓涓煙/娲诲姩鐩 褰曚綋绯荤粨鏋勮繘琛岀敤鎴疯璇佺殑鐜锛 *.Razor 瑙嗗浘鍙互浣垮緱 Web 搴旂敤绋嬪簭鐨勫紑鍙戝彉鍘嬪櫒寰楁洿鍔犳柟渚垮揩鎹; 绗竴澶 MVC 渚嬪瓙锛 涓嶇敤瑙嗗浘锛 public string Index() { return "鎴懧版槸潞?绗屄蹭竴掳?涓?MVC3鐨劽?渚嬄瀛惷伮-鈥-"; ...

鏂囨。鏍煎紡锛欴OC| 娴忚娆℃暟锛12| 涓婁紶鏃ユ湡锛2013-08-20 16:58:06| 鏂囨。鏄熺骇锛
MVC3 椤圭洰鍒涘缓锛 *.绌烘ā鏉块夐」鍙敓鎴愪竴涓 MVC3 搴旂敤绋嬪簭鎵闇瑕佺殑鏈灏戞枃浠跺拰鏂囦欢澶癸紱 *.Internet 搴旂敤绋嬪簭閫夐」鐢熸垚涓涓皬鍨嬬殑渚嬪瓙搴旂敤绋嬪簭锛 鍙湪鍏朵笂淇敼骞跺缓绔嬪叾瀹冨姛鑳斤紱 瀹冨寘鎷簡鐢ㄦ埛娉ㄥ唽涓庤璇併 瀵艰埅浠ュ強涓涓崗璋冪殑瑙嗚鏍峰紡锛 *.internet 搴旂敤绋嬪簭鏇村皬浜涳紝 浣嗗畠鏄璁$敤浜庨氳繃涓涓煙/娲诲姩鐩 褰曚綋绯荤粨鏋勮繘琛岀敤鎴疯璇佺殑鐜锛 *.Razor 瑙嗗浘鍙互浣垮緱 Web 搴旂敤绋嬪簭鐨勫紑鍙戝彉鍘嬪櫒寰楁洿鍔犳柟渚垮揩鎹; 绗竴澶 MVC 渚嬪瓙锛 涓嶇敤瑙嗗浘锛 public string Index() { return "鎴¨°鏄º?绗̨²涓°?涓?MVC3鐨Ì?渚¤y瀛Á¨®…-…-"; } 榛樿瑙嗗浘锛 public ActionResult Index() { return View(); } 鎸囧畾瑙嗗浘锛 public ActionResult Index() { return View("EmptView"); } public string Index(string name,int age=18) { return "娆?杩®-鎮¨²锛 êo"+name+" 鎮¨²鐨Ì?骞¨º榫¢?锛 êo"+age; } 璋冪敤锛 http://localhost:1452/test?name=aaa http://localhost:1452/test?name=aaa&age=20 榛樿瑙嗗浘浼犲弬浠ュ強鎺у埗鍣ㄥ皢鏁版嵁浼犻掔粰瑙嗗浘锛 鎺у埗鍣細 public ActionResult Index(string name, int age = 18) { ViewBag.vName = name; ViewBag.vAge = age; return View(); } 瑙嗗浘锛 娆?杩®-鎮¨²锛 êo @ViewBag.vName 鎮¨²鐨Ì?骞¨º榫¢?涓篴锛 êo@ViewBag.vAge 璋冪敤锛 http://localhost:1452/test?name=aaa http://localhost:1452/test?name=aaa&age=20 鎸囧畾瑙嗗浘浼犲弬浠ュ強鎺у埗鍣ㄥ皢鏁版嵁浼犻掔粰瑙嗗浘锛 鎺у埗鍣細 public ActionResult Index(string name, int age = 18) { ViewBag.vName = name; ViewBag.vAge = age; return View("EmptView"); } 瑙嗗浘锛 娆?杩®-鎮¨²锛 êo @ViewBag.vName 鎮¨²鐨Ì?骞¨º榫¢?涓篴锛 êo@ViewBag.vAge 璋冪敤锛 http://localhost:1452/test?name=aaa http://localhost:1452/test?name=aaa&age=20 璁茶В锛 1. 鎺у埗鍣ㄣ 瑙嗗浘鐨勫悕绉般 鍔ㄤ綔鏂规硶鍙婃枃浠跺す鍛藉悕瑙勫垯锛 2. 鍦板潃鏍忚鍒欙紱 灏唂or寰幆鍦ㄨ鍥句腑瀹炵幇锛 <ul> @for (int i = 0; i < ViewBag.vAge; i++) { <li>灏?for鍦¨²瑙º¨®鍥ª?涓璂涔º¨¦鍐¡ä绗̨² @i 娆ä?</li> } </ul> 涓涓 URL 骞朵笉绛夊悓浜庝竴涓〉闈 褰撲綘鍒涘缓涓涓紶缁熺殑 ASP. NET Web 绐椾綋搴旂敤绋嬪簭锛 鎴栬呮槸涓涓姩鎬佹湇鍔″櫒椤甸潰锛圓SP锛 搴旂敤绋嬪簭锛 鍦 URL 涓庨〉闈箣闂村瓨鍦ㄤ竴瀵逛竴鐨勫搴斻 濡傛灉浣犺姹傛湇鍔″櫒涓婄殑涓涓悕涓 SomePage. aspx鐨勯〉闈紝 閭d箞鏈濂藉湪纾佺洏涓婃湁涓涓 SomePage. aspx 椤甸潰銆 濡傛灉 SomePage. aspx 鏂囦欢骞朵笉瀛樺湪锛 浣犲皢浼氳幏寰椾竴涓笐闄嬬殑 404-椤甸潰涓嶅瓨鍦ㄩ敊璇 褰撳垱寤轰竴涓 ASP. NET MVC 搴旂敤绋嬪簭鏃跺垯澶т笉鐩稿悓锛 浣犻敭鍏ュ埌娴忚鍣ㄥ湴鍧鏍忕殑 URL 涓庝綘搴旂敤绋嬪簭涓殑鏂囦欢涔嬮棿骞舵病鏈変竴涓搴斿叧绯汇吉林省快三开奖—官方网址22270.COM 鍦ㄤ竴涓 ASP. NET MVC 搴旂敤绋嬪簭涓紝 涓涓 URL 涓庝竴涓帶鍒跺櫒鐨勫姩浣滅浉瀵瑰簲锛 鑰屼笉鏄鐩樹笂鐨勯〉闈€吉林省快三开奖—官方网址22270.COM 瀵逛簬涓涓紶缁熺殑 ASP.NET 鎴栬 ASP 搴旂敤绋嬪簭锛 娴忚鍣ㄨ姹傝鏄犲皠鍒颁簡椤甸潰銆 鍦 ASP.NET MVC搴旂敤绋嬪簭涓紝 娴忚鍣ㄨ姹傝鏄犲皠鍒颁簡鎺у埗鍣ㄥ姩浣溿 涓涓 ASP.NET Web 绐椾綋搴旂敤绋嬪簭鏄互鍐呭涓轰腑蹇冪殑銆 鑰屼竴涓 ASP.NET MVC 搴旂敤绋嬪簭鍒欎互鏄簲鐢ㄧ▼搴忛昏緫涓轰腑蹇冪殑銆 MVC 鍚勫潡鐨勪綔鐢細 MVC 涓庝紶缁 WEB 璇锋眰鐨勫樊鍒細 瀵逛簬涓涓紶缁熺殑 ASP. NET 鎴栬 ASP 搴旂敤绋嬪簭锛 娴忚鍣ㄨ姹傝鏄犲皠鍒颁簡椤甸潰銆吉林省快三开奖—官方网址22270.COM 鍦 ASP. NET MVC 搴旂敤绋嬪簭涓紝 娴忚鍣ㄨ姹傝鏄犲皠鍒颁簡鎺у埗鍣ㄥ姩浣溿 涓涓 ASP. NET Web 绐椾綋搴旂敤绋嬪簭鏄互鍐呭涓轰腑蹇冪殑銆傝屼竴涓 ASP. NET MVC 搴旂敤绋嬪簭鍒欎互鏄簲鐢ㄧ▼搴忛昏緫涓轰腑蹇冪殑銆吉林省快三开奖—官方网址22270.COM 鐞嗚В鎺у埗鍣 ——涔 ASP. NET MVC 涓帶鍒跺櫒銆 鎺у埗鍣ㄥ姩浣滀互鍙婃帶鍒跺櫒鍔ㄤ綔缁撴灉 鎺у埗鍣ㄨ礋璐g敤鎴蜂笌 MVC 搴旂敤绋嬪簭浜や簰鐨勬柟寮忋 褰撶敤鎴峰彂鍑烘祻瑙堝櫒璇锋眰鏃讹紝 鎺у埗鍣ㄥ喅瀹氬悜鐢ㄦ埛鍙戝洖浠涔堟牱鐨勫搷搴 鎺у埗鍣ㄤ腑鐨勪换浣曞叕鍏辨柟娉曢兘琚毚闇蹭负涓涓帶鍒跺櫒鍔ㄤ綔銆 瀵规浣犻渶瑕佸鍔犲皬蹇冦 杩欏氨鎰忓懗鐫鍖呭惈鍦ㄦ帶鍒跺櫒涓殑浠讳綍鍏叡鏂规硶閮藉彲浠ョ敱浠讳綍鍙互璁块棶浜掕仈缃戠殑浜鸿皟鐢紝 閫氳繃鍦ㄦ祻瑙堝櫒涓緭鍏ユ纭殑URL銆吉林省快三开奖—官方网址22270.COM 鎺у埗鍣ㄥ簲璇ヤ粎浠呭彧鍖呭惈鏈灏戦噺鐨勯昏緫锛 鐢ㄤ簬杩斿洖姝g‘鐨勮鍥炬垨鑰呭皢鐢ㄦ埛閲嶅畾鍚戝埌鍙︿竴涓姩浣溿 浠讳綍鍏朵粬鐨勪簨鎯呴兘搴旇鍖呭惈鍦ㄦā鍨嬩腑銆 鎺у埗鍣ㄥ彲鑳戒細杩斿洖涓涓壒瀹氱殑瑙嗗浘锛 鎴栬呮槸灏嗙敤鎴烽噸瀹氬悜鍒板彟涓涓帶鍒跺櫒 涓涓帶鍒跺櫒鏄竴涓户鎵胯嚜 System. Web. Mvc. Controller 鍩虹被鐨勭被銆 鍥犱负鎺у埗鍣ㄧ户鎵胯嚜杩欎釜鍩虹被锛屾墍浠ユ帶鍒跺櫒杞绘澗鍦扮户鎵夸簡涓浜涙湁鐢ㄧ殑鏂规硶 鎺у埗鍣ㄥ姩浣滄柟娉曪細 涓涓帶鍒跺櫒鍔ㄤ綔蹇呴』鏄帶鍒跺櫒绫荤殑涓涓叕鍏辨柟娉曘 C#鏂规硶锛 榛樿鏃讹紝 鏄鏈夋柟娉曘吉林省快三开奖—官方网址22270.COM 鎰忚瘑鍒颁綘娣诲姞鍒版帶鍒跺櫒绫讳腑鐨勪换浣曞叕鍏辨柟娉曢兘浼氳嚜鍔ㄨ鏆撮湶涓烘帶鍒跺櫒鍔ㄤ綔锛堜綘蹇呴』闈炲父灏忓績锛 鍥犱负鎺у埗鍣ㄥ姩浣滃彲浠ヨ鍏ㄧ悆鐨勪换浣曚汉璋冪敤锛 浠呬粎绠鍗曞湴閫氳繃鍦ㄦ祻瑙堝櫒鍦板潃鏍忚緭鍏ユ纭殑 URL锛 銆 鎺у埗鍣ㄥ姩浣滆繕瑕佹弧瓒充竴浜涢澶栫殑闇姹傘 浣滀负鎺у埗鍣ㄥ姩浣滄潵浣跨敤鐨勬柟娉曚笉鑳藉閲嶈浇銆 鍙﹀锛 鎺у埗鍣ㄥ姩浣滀笉鑳戒负闈欐佹柟娉曘 闄や簡杩欎簺浠ュ锛 浣犲彲浠ュ皢浠讳綍鏂规硶浣滀负鎺у埗鍣ㄥ姩浣滄潵浣跨敤銆 鎺у埗鍣ㄧ殑缁撴灉锛 鎺у埗鍣ㄥ姩浣滆繑鍥炰竴绉嶅彨鍋氬姩浣滅粨鏋滐紙Action Result锛 鐨勪笢瑗裤 鍔ㄤ綔缁撴灉鏄帶鍒跺櫒鍔ㄤ綔杩斿洖缁欐祻瑙堝櫒璇锋眰鐨勪笢瑗裤 ASP. NET MVC 妗嗘灦鏀寔鍏鏍囧噯绫诲瀷鐨勫姩浣滅粨鏋滐細 1. ViewResult – 浠h〃 HTML 鍙婃爣璁般 2. EmptyResult – 浠h〃鏃犵粨鏋溿 3. RedirectResult – 浠h〃閲嶅畾鍚戝埌涓涓柊鐨 URL銆 4. RedirectToRouteResult – 浠h〃閲嶅畾鍚戝埌涓涓柊鐨勬帶鍒跺櫒鍔ㄤ綔銆 5. JsonResult – 浠h〃涓涓 JSON锛圝avascript Object Notation锛 缁撴灉锛 瀹冨彲浠ョ敤浜嶢JAX 搴旂敤绋嬪簭銆 6. ContentResult – 浠h〃鐫鏂囨湰缁撴灉銆 鎵鏈夎繖浜涘姩浣滅粨鏋滈兘缁ф壙鑷 ActionResult 鍩虹被銆 鍦ㄥぇ澶氭暟鎯呭喌涓嬶紝 鎺у埗鍣ㄥ姩浣 ViewResult銆 渚嬪锛 浠g爜娓呭崟 2 涓殑 Index() 鎺у埗鍣ㄥ姩浣滆繑鍥炰簡涓涓 ViewResult銆 娉ㄦ剰鍒颁唬鐮佹竻鍗2涓殑Index()鍔ㄤ綔骞舵病鏈夋斁鍥炰竴涓猇iewResult() 銆傝屾槸璋冪敤浜 Controller鍩虹被鐨 View()鏂规硶銆 閫氬父鎯呭喌涓嬶紝 浣犲苟涓嶇洿鎺ヨ繑鍥炰竴涓姩浣滅粨鏋溿 鑰屾槸璋冪敤 Controller 鍩虹被鐨勪笅鍒楁柟娉曚箣涓锛 1. View – 杩斿洖涓涓 ViewResult 缁撴灉銆 2. Redirect – 杩斿洖涓涓 RedirectResult 鍔ㄤ綔缁撴灉銆 3. RedirectToAction – 杩斿洖涓涓 RedirectToAction 鍔ㄤ綔缁撴灉銆 4. RedirectToRoute – 杩斿洖涓涓 RedirectToRoute 鍔ㄤ綔缁撴灉銆 5. Json – 杩斿洖涓涓 JsonResult 鍔ㄤ綔缁撴灉銆 6. Content – 杩斿洖涓涓 ContentResult 鍔ㄤ綔缁撴灉銆 鍥犳锛 濡傛灉浣犳兂鍚戞祻瑙堝櫒杩斿洖涓涓鍥撅紝 浣犲彲浠ヨ皟鐢 View() 鏂规硶銆 濡傛灉浣犳兂瑕侀檷鐢ㄦ埛浠庝竴涓帶鍒跺櫒鍔ㄤ綔閲嶅畾鍚戝埌鍙︿竴涓紝 浣犲彲浠ヨ皟鐢 RedirectToAction() 鏂规硶銆 ContentResult 鍔ㄤ綔缁撴灉寰堢壒鍒 浣犲彲浠ヤ娇鐢 ContentResult 鍔ㄤ綔缁撴灉鏉ュ皢鍔ㄤ綔缁撴灉浣滀负绾枃鏈繑鍥炪 涓句釜渚嬪瓙锛 濡備笅浠g爜涓殑 Index() 鏂规硶灏嗘秷鎭綔涓轰簡绾枃鏈繑鍥烇紝 鑰屼笉鏄 HTML銆 public ContentResult Index() { return Content("澶¬¨¬娑?娴¤?瀛Á¨®"); } 褰撹皟鐢ㄤ笂闈㈠姩浣滄椂锛 骞舵病鏈夎繑鍥炰竴涓鍥俱 鑰屾槸鍚戞祻瑙堝櫒杩斿洖浜嗗師濮嬬殑鏂囨湰“澶╂动娴瓙” 銆 娉ㄦ剰锛 鍒涘缓鎺у埗鍣ㄧ被搴旇娉ㄦ剰锛 飦 濡傛灉浣犲垱寤轰竴涓帶鍒跺櫒锛 瀹冧笉鍚湁 Controller 鍚庣紑锛 閭d箞浣犲皢鏃犳硶璋冪敤杩欎釜鎺у埗鍣 飦 鎴戜滑搴旇鎬绘槸鍦 Controllers 鏂囦欢澶逛腑鍒涘缓鎺у埗鍣紙铏界劧涓嶈繖涔堝仛涔熷彲浠ワ級 銆 鍚﹀垯鐨勮瘽锛屽氨鐮村潖浜 ASP. NET MVC 鐨勬儻渚嬶紝 鍏朵粬鐨勭▼搴忓憳灏嗕細鑺辫垂鏇村鑹拌緵鐨勬椂闂存潵鐞嗚В浣犵殑搴旂敤绋嬪簭銆 鍒涘缓鍔ㄤ綔鏂规硶搴旇娉ㄦ剰锛 涓轰簡灏嗘柟娉曚綔涓轰竴涓姩浣滃叕甯冪粰鍏ㄤ笘鐣岋紝 鏂规硶蹇呴』婊¤冻鐗瑰畾鐨勮姹傦細 • 鏂规硶蹇呴』鏄叕鍏辩殑銆 • 鏂规硶涓嶈兘鏄潤鎬佹柟娉曘 • 鏂规硶涓嶈兘浣挎墿灞曟柟娉曘 • 鏂规硶涓嶈兘鏄瀯閫犲嚱鏁帮紝 璁块棶鍣紝 鎴栬呰缃櫒銆 • 鏂规硶涓嶈兘鎷ユ湁寮鏀炬硾鍨嬬被鍨嬶紙open generic types锛 銆 • 鏂规硶涓嶈兘浣挎帶鍒跺櫒鍩虹被涓殑鏂规硶銆 • 鏂规硶涓嶈兘鍚湁 ref 鎴栬 out 鍙傛暟銆 • 闃绘鍏叡鏂规硶琚皟鐢ㄤ娇鐢╗NonAction]鐗规ц繘琛屼簡淇グ [NonAction] public ContentResult Index() { return Content("澶¬¨¬娑?娴¤?瀛Á¨®"); } • 鍖呭惈鍦ㄦ帶鍒跺櫒绫讳腑鐨勪换浣曞叕鍏辨柟娉曪紝 閮借鏆撮湶涓烘帶鍒跺櫒鍔ㄤ綔銆 娉ㄦ剰杩欓噷銆 涓涓帶鍒跺櫒鍔ㄤ綔琚毚闇茬粰浜嗗叏涓栫晫銆備换浣曚汉閮藉彲浠ラ氳繃鍦 Web 娴忚鍣ㄧ殑鍦板潃鏍忎腑杈撳叆姝g‘鐨 URL鏉ヨ皟鐢ㄦ帶鍒跺櫒鍔ㄤ綔銆 鍥犳锛 鍦ㄤ綘骞朵笉闇瑕佹柟娉曡璋冪敤鏃讹紝 涓嶈闅忔剰鍦板湪鎺у埗鍣ㄤ腑鍒涘缓鍏叡鏂规硶銆 • 鐞嗚В瑙嗗浘 瑙嗗浘鍚湁灏嗕細鍙戦佺粰娴忚鍣 HTML 鏍囪鍜屽唴瀹广 褰撲娇鐢 ASP. NET MVC 搴旂敤绋嬪簭鏃讹紝 涓涓鍥剧瓑鍚屼簬涓涓〉闈€ 涓鑸岃█锛 濡傛灉浣犳兂涓轰竴涓帶鍒跺櫒鍔ㄤ綔杩斿洖涓涓鍥撅紝 閭d箞浣犻渶瑕佸湪 Views 鏂囦欢澶逛笅鍒涘缓涓涓瓙鏂囦欢澶癸紝 杩欎釜鏂囦欢澶逛笌浣犵殑鎺у埗鍣ㄥ悓鍚嶃 鍦ㄥ瓙鏂囦欢澶逛笅锛 浣犲繀椤诲垱寤轰竴涓. aspx 鏂囦欢锛 瀹冪殑鍚嶅瓧涓庢帶鍒跺櫒鍔ㄤ綔鐩稿悓銆 瑙嗗浘搴旇浠呭寘鍚笌鐢熸垚鐢ㄦ埛鐣岄潰鏈夊叧鐨勯昏緫銆 榛樿鎯呭喌涓嬶紝 瑙嗗浘搴旇鍜屼笌鍏剁浉搴旂殑鎺у埗鍣ㄥ姩浣滄嫢鏈夌浉鍚岀殑鍚嶇О銆 瑙嗗浘鍚屾牱搴旇琚疆浜庝竴涓枃浠 澶逛腑锛 璇ユ枃浠跺す涓庢帶鍒跺櫒鐨勫悕绉扮浉瀵瑰簲銆 <a href="/Home/Create">Add new Task</a>锛 杩欎釜閾炬帴鎸囧悜鍒颁簡/Home/Create 璺緞銆 褰撲綘鐐瑰嚮杩欎釜閾炬帴锛 HomeController 鐨 Create() 鍔ㄤ綔灏嗕細琚皟鐢ㄣ Create()鏂规硶杩斿洖 Create 瑙嗗浘 鐞嗚В妯″瀷 MVC 鐨勬ā鍨嬪寘鍚簡浣犲簲鐢ㄧ▼搴忎腑鐨勬墍鏈夐昏緫锛 杩欎簺閫昏緫娌℃湁鍖呭惈鍦ㄨ鍥炬垨鑰呮帶鍒跺櫒涓 妯″瀷搴旇鍖呭惈浣犵殑搴旂敤绋嬪簭涓殑鎵鏈変笟鍔¢昏緫鍜屾暟鎹簱璁块棶閫昏緫銆 渚嬪锛 濡傛灉浣犱娇鐢 LINQ to SQL 璁块棶鏁版嵁搴擄紝 閭d箞浣犲彲浠ュ湪 Models 鏂囦欢澶逛腑鍒涘缓浣犵殑 LINQ to SQL 绫伙紙浣犵殑 dbml 鏂囦欢锛 銆 鐞嗚В HTML Helpers ASP. NET MVC 妗嗘灦鍖呭惈浜嗕笅闈㈢殑鏍囧噯 HTML Helpers 闆嗗悎锛堣繖閲屾病鏈夊垪鍏級 锛 • Html. ActionLink() • Html. BeginForm() • Html. CheckBox() • Html. DropDownList() • Html. EndForm() • Html. Hidden() • Html. ListBox() • Html. Password() • Html. RadioButton() • Html. TextArea() • Html. TextBox() Html. BeginForm() Helper 鏂规硶鐢ㄤ簬鍒涘缓 HTML<form>鐨勫紑闂爣绛俱傛敞鎰忓埌 Html. BeginForm() 鏂规硶鍦ㄤ竴涓 using 璇彞鍐呰璋冪敤銆 using 璇彞纭繚浜<form>鏍囪鍦 using 鍧楁湯灏惧叧闂 濡傛灉浣犲枩娆紝 鍙互涓嶅垱寤 using 鍧楋紝 浣犲彲浠ヨ皟鐢 Html. EndForm() Helper 鏂规硶鏉ュ叧闂<form>鏍囩銆 浣跨敤瀵逛綘鏉ヨ鎰熻鏈濂界殑鏂瑰紡鏉ュ垱寤<form>鐨勫紑闂爣绛俱 Html. TextBox() Helper 鏂规硶鐢ㄤ簬鍦ㄤ唬鐮佹竻鍗 1 涓憟鐜 HTML<input>鏍囩銆 濡傛灉浣犲湪浣犵殑娴忚鍣ㄤ腑閫夋嫨“鏌ョ湅婧愭枃浠” 锛 閭d箞浣犱細鐪嬪埌浠g爜娓呭崟 2 涓殑 HTML 婧愪唬鐮併 娉ㄦ剰鍒版簮浠g爜涓寘鍚簡鏍囧噯鐨 HTML 鏍囩銆 NOTE锛 娉ㄦ剰 Html. TextBox() 锛 HTML Helper 涔 MVC3 涔嬪墠浣跨敤<%= %>鏍囩鏉ュ憟鐜帮紝 鑰屼笉鏄<% %>鏍囩銆 濡傛灉浣犱笉鍖呭惈杩欎釜绛夊彿锛 閭d箞涓嶄細鏈変换浣曚笢瑗垮憟鐜拌嚦娴忚鍣ㄣ MVC3 浣跨敤@ ASP. NET MVC妗嗘灦鍖呭惈寰堝皯涓浜汬elpers 鏂规硶銆傛洿鍙兘鐨勬槸锛屼綘闇瑕佷娇鐢ㄨ嚜瀹氫箟HTML Helpers鏉ユ墿灞 MVC 妗嗘灦銆 鍦ㄨ繖绡囨暀绋嬬殑鍓╀綑閮ㄥ垎锛 浣犱細瀛︿範涓や釜鍒涘缓鑷畾涔 HTML Helpers 鐨勬柟娉曘

鍏虫敞鎴戜滑

鍏虫敞寰俊鍏紬鍙

鎮ㄩ夋嫨浜嗕互涓嬪唴瀹