Add project files.

This commit is contained in:
2024-07-26 18:49:07 +03:30
parent 6e7520e2c4
commit 9073475fb0
102 changed files with 86794 additions and 0 deletions

View File

@ -0,0 +1,26 @@

@{
ViewBag.Title = "Login";
}
<h2>Login</h2>
<form asp-action="Login" asp-controller="Account" method="post">
<div asp-validation-summary="All"></div>
<div class="form-group">
<label  
asp-for="username">username</label>
<input asp-for="username" class="form-control" required />
<span asp-validation-for="Username" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="password">password</label>
<input asp-for="password"  
type="password" class="form-control" required />
<span asp-validation-for="Password" class="text-danger"></span>
</div>
<br />
<button type="submit" class="btn btn-primary">Login</button>
</form>

View File

@ -0,0 +1,56 @@

@{
ViewBag.Title = "Register";
}
<h2>Register</h2>
<script>
function checkPasswords() {
var password = document.getElementById("password");
var confirmPassword = document.getElementById("ConfirmPassword");  
var errorMessage = document.getElementById("passwordMismatch");
if (password.value !== confirmPassword.value) {
errorMessage.textContent = "Passwords do not match.";
return false;
}
else {
errorMessage.textContent = "";
return true;
}
}
</script>
<form asp-action="Register" asp-controller="Account" method="post">
<div asp-validation-summary="All"></div>
<div class="form-group">
<label  
asp-for="username"> username </label>
<input asp-for="username" class="form-control" required />
<span asp-validation-for="username" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="password"> password </label>
<input asp-for="password" id="password" 
type="password" class="form-control" required/>
<span asp-validation-for="password" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="ConfirmPassword">Confirm Password</label>
<input asp-for="ConfirmPassword" id="ConfirmPassword"
type="password" class="form-control" oninput="checkPasswords()" required />
<span asp-validation-for="ConfirmPassword" class="text-danger"></span>
<span id="passwordMismatch" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="displayname">display name</label>
<input asp-for="displayname" class="form-control" required />
<span asp-validation-for="displayname" class="text-danger" ></span>
</div>
<br />
<button type="submit" class="btn btn-primary">Register</button>
</form>

9
Views/Home/About.cshtml Normal file
View File

@ -0,0 +1,9 @@
@{
ViewBag.Title = "About";
}
<main aria-labelledby="title">
<h2 id="title">@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<p>Use this area to provide additional information.</p>
</main>

19
Views/Home/Contact.cshtml Normal file
View File

@ -0,0 +1,19 @@
@{
ViewBag.Title = "Contact";
}
<main aria-labelledby="title">
<h2 id="title">@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>
<address>
One Microsoft Way<br />
Redmond, WA 98052-6399<br />
<abbr title="Phone">P:</abbr>
425.555.0100
</address>
<address>
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br />
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
</address>
</main>

33
Views/Home/Index.cshtml Normal file
View File

@ -0,0 +1,33 @@
@{
ViewBag.Title = "Home Page";
}
<main>
<section class="row" aria-labelledby="aspnetTitle">
<h1 id="title">ASP.NET</h1>
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
<p><a href="https://asp.net" class="btn btn-primary btn-md">Learn more &raquo;</a></p>
</section>
<div class="row">
<section class="col-md-4" aria-labelledby="gettingStartedTitle">
<h2 id="gettingStartedTitle">Getting started</h2>
<p>
ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that
enables a clean separation of concerns and gives you full control over markup
for enjoyable, agile development.
</p>
<p><a class="btn btn-outline-dark" href="https://go.microsoft.com/fwlink/?LinkId=301865">Learn more &raquo;</a></p>
</section>
<section class="col-md-4" aria-labelledby="librariesTitle">
<h2 id="librariesTitle">Get more libraries</h2>
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
<p><a class="btn btn-outline-dark" href="https://go.microsoft.com/fwlink/?LinkId=301866">Learn more &raquo;</a></p>
</section>
<section class="col-md-4" aria-labelledby="hostingTitle">
<h2 id="hostingTitle">Web Hosting</h2>
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
<p><a class="btn btn-outline-dark" href="https://go.microsoft.com/fwlink/?LinkId=301867">Learn more &raquo;</a></p>
</section>
</div>
</main>

13
Views/Shared/Error.cshtml Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Error</title>
</head>
<body>
<hgroup>
<h1>Error.</h1>
<h2>An error occurred while processing your request.</h2>
</hgroup>
</body>
</html>

View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - My ASP.NET Application</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-dark bg-dark">
<div class="container">
@Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
<button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" title="Toggle navigation" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li>@Html.ActionLink("Home", "Index", "Home", new { area = "" }, new { @class = "nav-link" })</li>
<li>@Html.ActionLink("About", "About", "Home", new { area = "" }, new { @class = "nav-link" })</li>
<li>@Html.ActionLink("Contact", "Contact", "Home", new { area = "" }, new { @class = "nav-link" })</li>
<li>@Html.ActionLink("Login", "Login", "Account", new { area = "" }, new { @class = "nav-link" })</li>
<li>@Html.ActionLink("Register", "Register", "Account", new { area = "" }, new { @class = "nav-link" })</li>
</ul>
</div>
</div>
</nav>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
</footer>
</div>
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
</body>
</html>

View File

@ -0,0 +1,7 @@

@{
ViewBag.Title = "Latest";
}
<h2>Latest</h2>

View File

@ -0,0 +1,7 @@

@{
ViewBag.Title = "index";
}
<h2>Whats good?</h2>

View File

@ -0,0 +1,14 @@

@{
ViewBag.Title = "submit";
}
<h2>submit a new article</h2>
<h3>what's new?'</h3>
<form>
title: <input /> <br /><br />
link: <input /> <br /><br />
summary: <input /> <br /><br />
content: <textarea> </textarea> <br /><br />
<input type="submit" />
</form>

43
Views/Web.config Normal file
View File

@ -0,0 +1,43 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization"/>
<add namespace="System.Web.Routing" />
<add namespace="WebApplication1" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
<system.web>
<compilation>
<assemblies>
<add assembly="System.Web.Mvc, Version=5.2.9.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
</configuration>

3
Views/_ViewStart.cshtml Normal file
View File

@ -0,0 +1,3 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}