예제 #1
0
        [Route("/")]                 // root path or home page. always needed
        public ActionResult Letter() // this method must be named 'Letter()' for the View() method to find the correct content to show - Letter.cshtml. same for Postcard() and Form() etc.
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = "Emma";
            myLetterVariable.Sender    = "Tawnee";
            return(View(myLetterVariable));
        }
예제 #2
0
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = "Chadwick";
            myLetterVariable.Sender    = "Chadstein";
            return(View(myLetterVariable));
        }
예제 #3
0
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = "Geoff";
            myLetterVariable.Sender    = "Brandan";
            return(View(myLetterVariable));
        }
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = "Constantine";
            myLetterVariable.Sender    = "Rolf";
            return(View(myLetterVariable));
        }
예제 #5
0
        public ActionResult Journal()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetRecipient("Lina");
            myLetterVariable.SetSender("Jake");
            return(View(myLetterVariable));
        }
예제 #6
0
        public ActionResult ProjectName(string recipient)
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = recipient;

            return(View(myLetterVariable));
        }
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetRecipient("Lina");
            myLetterVariable.SetSender("Eliot");
            return(View(myLetterVariable));
        }
예제 #8
0
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = "Johann";
            myLetterVariable.Sender    = "Philip";
            return(View(myLetterVariable));
        }
예제 #9
0
        public ActionResult Letter()//ActionResult is a built-in MVC class that handles rendering views; View() is a built-in method from `Microsoft.AspNetCore.Mvc` namespace to return a view when route is invoked
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = "Lina";
            myLetterVariable.Sender    = "Jasmine";
            return(View(myLetterVariable));
        }
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = "(not)Master Skywalker";
            myLetterVariable.Sender    = "Obi-Wan Kenobi";
            return(View(myLetterVariable));
        }
예제 #11
0
        [HttpGet("/")]              //define url
        public ActionResult Hello() //send class with two strings to Hello.cshtml
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetRecipient("Jessica");
            myLetterVariable.SetSender("Bob");
            return(View(myLetterVariable));
        }
예제 #12
0
        public ActionResult Hello()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetSender("ENTER SENDER NAME HERE");
            myLetterVariable.SetRecipient("ENTER RECIPIENT NAME HERE");
            return(View(myLetterVariable));
        }
예제 #13
0
        public ActionResult Hello()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            //myLetterVariable.Recipient = "Jessica";
            // myLetterVariable.SetRecipient("Jessica");
            return(View(myLetterVariable));
        }
예제 #14
0
        public ActionResult Postcard(string recipient, string sender) // these link to the inputs named in Postcard.cshtml - name="sender" and name="recipient"
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = recipient;
            myLetterVariable.Sender    = sender;
            return(View(myLetterVariable));
        }
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetRecipient("Jessica");
            myLetterVariable.SetSender("John");
            return(View(myLetterVariable));
        }
예제 #16
0
        public ActionResult Postcard(string recipient, string sender)
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = recipient;
            myLetterVariable.Sender    = sender;
            return(View(myLetterVariable));
        }
예제 #17
0
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = "Lina";
            myLetterVariable.Sender    = "Jasmine";
            return(View(myLetterVariable));
        }
예제 #18
0
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetRecipient("Sam");
            myLetterVariable.SetSender("Diane");
            return(View(myLetterVariable));
        }
예제 #19
0
        public ActionResult Postcard(string recipient, string sender)
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetRecipient(recipient);
            myLetterVariable.SetSender(sender);
            return(View(myLetterVariable));
        }
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = "Harrison";
            myLetterVariable.Sender    = "Sarah";
            return(View(myLetterVariable));
        }
예제 #21
0
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = "Tyler";
            myLetterVariable.Sender    = "Svea";
            return(View(myLetterVariable));
        }
예제 #22
0
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = "Joel and Lauren";
            myLetterVariable.Sender    = "Hailey and Jacqueline";
            return(View(myLetterVariable));
        }
예제 #23
0
        public ActionResult GreetingCard()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetRecipient(Request.Query["recipient"]);
            myLetterVariable.SetSender(Request.Query["sender"]);
            return(View("Hello", myLetterVariable));
        }
예제 #24
0
        public ActionResult Hello()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetRecipient("David");
            myLetterVariable.SetSender("Brian");
            return(View(myLetterVariable));
        }
예제 #25
0
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetRecipient("Aladdin");
            myLetterVariable.SetSender("Jafar");
            return(View(myLetterVariable));
        }
예제 #26
0
        public ActionResult Letter()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetRecipient("Pavel");
            myLetterVariable.SetSender("Olga");
            myLetterVariable.SetLocation("Bucharest");
            return(View(myLetterVariable));
        }
예제 #27
0
        public ActionResult MadLibsGenerator(string name, string place, string adjective1)
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetName(name);
            myLetterVariable.SetPlace(place);
            myLetterVariable.SetAdjective1(adjective1);
            return(View(myLetterVariable));
        }
예제 #28
0
        public ActionResult MadLibFill()
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.SetPronoun(Request.Query["pronoun"]);
            myLetterVariable.SetVerb(Request.Query["verb"]);
            myLetterVariable.SetNoun(Request.Query["noun"]);
            return(View("MadLibFill", myLetterVariable));
        }
예제 #29
0
        public ActionResult Postcard(string recipient, string sender) //Here we create a new Postcard() route. This time, the route's method takes arguments: a string for both recipient and sender. Because we told our <form> in Form.cshtml to have an action="/postcard", the route matching the /postcard path is automatically invoked. That's our Postcard() route. Our form has two <input>s, one with a name="sender" attribute and another with a name="recipient" attribute. These are the parameters we pass into the route method.  ALL CAPS : Note that our application is looking for name attributes, not the id or anything else. These must match the parameters we pass into the route method. This must be an exact match or it will not work.

        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = recipient;
            myLetterVariable.Sender    = sender;
            return(View(myLetterVariable)); //this was added after putting HTML into Postcard.html
        }
예제 #30
0
        public ActionResult Postcard(string recipient, string sender, string location, string souvenir)
        {
            LetterVariable myLetterVariable = new LetterVariable();

            myLetterVariable.Recipient = recipient;
            myLetterVariable.Sender    = sender;
            myLetterVariable.Location  = location;
            myLetterVariable.Souvenir  = souvenir;
            return(View(myLetterVariable));
        }