, VisualStudio URL-, , . , , - .
URL- , Project () VisualStudio PartyInvitesProperties ( PartyInvites), Web SpecificPage ( ) StartAction ( ), :
- VisualStudio URL- , Index Home.
RsvpForm , " RSVP". :
MVC , , . " RSVP" , . , RsvpForm Home, MVC .
. , , , ASP.NET WebForms, . , MVC.
, . RsvpForm, .
, HTTP- GET. , - , GET. , - /Home/RsvpForm.
, HTTP- POST. , Html.BeginForm, POST. , .
GET POST C# , .. . URL, MVC - GET POST. , HomeController.
using System;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Mvc;usingPartyInvites.Models; namespacePartyInvites.Controllers{publicclassHomeController: Controller {publicViewResultIndex(){int hour = DateTime.Now.Hour;ViewBag.Greeting = hour<12?" ":" ";return View(); } [HttpGet]publicViewResultRsvpForm(){return View(); } [HttpPost]publicViewResultRsvpForm(GuestResponse guest){// no // .returnView("Thanks", guest); } }}RsvpForm HttpGet. MVC, GET.
|
|
RsvpForm, GuestResponse, HttpPost. MVC, POST. , PartyInvites.Models. , GuestResponse . .