Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @{
- List<string> rules = new List<string>();
- Session["rules"] = rules;
- rules.Add("You do not talk about FIGHT CLUB.");
- rules.Add("You DO NOT talk about FIGHT CLUB.");
- rules.Add("If someone says \"stop\" or goes limp, taps out the fight is over.");
- //Session.Add("rules", "You do not talk about FIGHT CLUB.");
- //Session.Add("rules", "You DO NOT talk about FIGHT CLUB.");
- //Session.Add("rules", "If someone says \"stop\" or goes limp, taps out the fight is over.");
- if (Request.Form["rule"] != null && Request.Form["rule"].Length > 0)
- {
- //rules.Add(Request.Form["rule"]);
- //rules = (List<string>)Session["var"];
- HttpContext.Current.Session.Add("rule", Request.Form["rule"]);
- }
- }
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <form action="" method="post">
- Add rule: <input type="text" name="rule"><br>
- <input type="submit" value="Submit">
- </form>
- <ul>
- @foreach (string rule in rules)
- {
- <li>@rule</li>
- }
- </ul>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement