23.09.2015 Views

ASP.NET

精采試讀

精采試讀

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PART<br />

<br />

namespace MvcGuestbook.Controllers<br />

{<br />

public class HomeController : Controller<br />

{<br />

public ActionResult Index()<br />

{<br />

ViewBag.Message = " <strong>ASP</strong>.<strong>NET</strong> MVC ";<br />

return View();<br />

}<br />

public ActionResult About()<br />

{<br />

ViewBag.Message = "";<br />

return View();<br />

}<br />

01<br />

02<br />

03-0303<br />

<br />

<br />

<br />

<br />

<br />

<strong>ASP</strong>.<strong>NET</strong> MVC<br />

<br />

<br />

04<br />

05<br />

06<br />

public ActionResult Contact()<br />

{<br />

ViewBag.Message = "";<br />

";<br />

}<br />

}<br />

}<br />

return View();<br />

(Controller) <br />

ControllerGuestbookControllerGuestbook<br />

erGuestbook<br />

<br />

Controller (IController)<br />

ActionResult<strong>ASP</strong>.<strong>NET</strong><br />

N<br />

MVC (Action)<br />

IndexViewBagdynamic<br />

<strong>ASP</strong>.<strong>NET</strong> MVC<br />

View<br />

ViewBag.Message = " <strong>ASP</strong>.<strong>NET</strong> MVC ";<br />

CHAPTER 03 67

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!