Commit 42134bd9 authored by ferhat tamer's avatar ferhat tamer 💬
Browse files

Initial commit

parents
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
namespace haftalik.Data;
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}
namespace haftalik.Data;
public class WeatherForecastService
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
public Task<WeatherForecast[]> GetForecastAsync(DateTime startDate)
{
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
}).ToArray());
}
}
@page "/counter"
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}
@page
@model haftalik.Pages.ErrorModel
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Error</title>
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
</head>
<body>
<div class="main">
<div class="content px-4">
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
</div>
</div>
</body>
</html>
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace haftalik.Pages;
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private readonly ILogger<ErrorModel> _logger;
public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
@page "/fetchdata"
<PageTitle>Weather forecast</PageTitle>
@using haftalik.Data
@inject WeatherForecastService ForecastService
<h1>Weather forecast</h1>
<p>This component demonstrates fetching data from a service.</p>
@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}
@code {
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
}
}
@page "/"
<PageTitle>Index</PageTitle>
<h1>Hello, world!</h1>
Welcome to your new app.
<SurveyPrompt Title="How is Blazor working for you?" />
@page "/pr1"
<h1>Haftalık Ders</h1>
<p>
<label>
Program
<input @bind="yeniProgram" />
</label>
<button @onclick="EkleMetni">
EKLE
</button>
<button @onclick="GüncelleMetni">
GÜNCELLE
</button>
<button @onclick="SilMetni">
SİL
</button>
</p>
<body>
<table style="width:100%">
<tr>
<th>Pazartesi</th>
<th>Salı</th>
<th>Çarşamba</th>
<th>Perşembe</th>
<th>Cuma</th>
</tr>
<tr>
<td><button @onclick="btn0" Height="50px" Weight="50px" >@metin0</button></td>
<td><button @onclick="btn1" Height="50px" Weight="50px">@metin1</button></td>
<td><button @onclick="btn2" Height="50px" Weight="50px">@metin2</button></td>
<td><button @onclick="btn3" Height="50px" Weight="50px">@metin3</button></td>
<td><button @onclick="btn4" Height="50px" Weight="50px">@metin4</button></td>
</tr>
<tr>
<td><button @onclick="btn5" Height="50px" Weight="50px">@metin5</button></td>
<td><button @onclick="btn6" Height="50px" Weight="50px">@metin6</button></td>
<td><button @onclick="btn7" Height="50px" Weight="50px">@metin7</button></td>
<td><button @onclick="btn8" Height="50px" Weight="50px">@metin8</button></td>
<td><button @onclick="btn9" Height="50px" Weight="50px">@metin9</button></td>
</tr>
<tr>
<td><button @onclick="btn10" Height="50px" Weight="50px">@metin10</button></td>
<td><button @onclick="btn11" Height="50px" Weight="50px">@metin11</button></td>
<td><button @onclick="btn12" Height="50px" Weight="50px">@metin12</button></td>
<td><button @onclick="btn13" Height="50px" Weight="50px">@metin13</button></td>
<td><button @onclick="btn14" Height="50px" Weight="50px">@metin14</button></td>
</tr>
<tr>
<td><button @onclick="btn15" Height="50px" Weight="50px">@metin15</button></td>
<td><button @onclick="btn16" Height="50px" Weight="50px">@metin16</button></td>
<td><button @onclick="btn17" Height="50px" Weight="50px">@metin17</button></td>
<td><button @onclick="btn18" Height="50px" Weight="50px">@metin18</button></td>
<td><button @onclick="btn19" Height="50px" Weight="50px">@metin19</button></td>
</tr>
<tr>
<td><button @onclick="btn20" Height="50px" Weight="50px">@metin20</button></td>
<td><button @onclick="btn21" Height="50px" Weight="50px">@metin21</button></td>
<td><button @onclick="btn22" Height="50px" Weight="50px">@metin22</button></td>
<td><button @onclick="btn23" Height="50px" Weight="50px">@metin23</button></td>
<td><button @onclick="btn24" Height="50px" Weight="50px">@metin24</button></td>
</tr>
<tr>
<td><button @onclick="btn25" Height="50px" Weight="50px">@metin25</button></td>
<td><button @onclick="btn26" Height="50px" Weight="50px">@metin26</button></td>
<td><button @onclick="btn27" Height="50px" Weight="50px">@metin27</button></td>
<td><button @onclick="btn28" Height="50px" Weight="50px">@metin28</button></td>
<td><button @onclick="btn29" Height="50px" Weight="50px">@metin29</button></td>
</tr>
<tr>
<td><button @onclick="btn30" Height="50px" Weight="50px">@metin30</button></td>
<td><button @onclick="btn31" Height="50px" Weight="50px">@metin31</button></td>
<td><button @onclick="btn32" Height="50px" Weight="50px">@metin32</button></td>
<td><button @onclick="btn33" Height="50px" Weight="50px">@metin33</button></td>
<td><button @onclick="btn34" Height="50px" Weight="50px">@metin34</button></td>
</tr>
<tr>
<td><button @onclick="btn35" Height="50px" Weight="50px">@metin35</button></td>
<td><button @onclick="btn36" Height="50px" Weight="50px">@metin36</button></td>
<td><button @onclick="btn37" Height="50px" Weight="50px">@metin37</button></td>
<td><button @onclick="btn38" Height="50px" Weight="50px">@metin38</button></td>
<td><button @onclick="btn39" Height="50px" Weight="50px">@metin39</button></td>
</tr>
</table>
<style>
table, th, td {
border:1px solid black;
}
.button {
width=20px;
height=20px;
}
</style>
</body>
namespace haftalik.Pages
{
public partial class Pr1
{
private string metin = " ";
private string? yeniProgram,metin0,metin1,metin2,metin3,metin4,metin5,metin6,metin7,metin8,metin9,metin10,metin11,metin12,metin13,metin14,metin15,metin16,metin17,metin18
,metin19,metin20,metin21,metin22,metin23,metin24,metin25,metin26,metin27,metin28,metin29,metin30,metin31,metin32,metin33,metin34,metin35,metin36,metin37,metin38,metin39,metin40;
private string? Delete ;
private void EkleMetni()
{
metin = $"{yeniProgram}";
}
private void GüncelleMetni()
{
metin = $"{yeniProgram}";
}
private void SilMetni()
{
yeniProgram=" ";
metin =" ";
}
private void btn0()
{
metin0 = $"{yeniProgram}";
}
private void btn1()
{
metin1 = $"{yeniProgram}";
}
private void btn2()
{
metin2 = $"{yeniProgram}";
}
private void btn3()
{
metin3 = $"{yeniProgram}";
}
private void btn4()
{
metin4 = $"{yeniProgram}";
}
private void btn5()
{
metin5 = $"{yeniProgram}";
}
private void btn6()
{
metin6 = $"{yeniProgram}";
}
private void btn7()
{
metin7 = $"{yeniProgram}";
}
private void btn8()
{
metin8 = $"{yeniProgram}";
}
private void btn9()
{
metin9 = $"{yeniProgram}";
}
private void btn10()
{
metin10 = $"{yeniProgram}";
}
private void btn11()
{
metin11 = $"{yeniProgram}";
}
private void btn12()
{
metin12 = $"{yeniProgram}";
}
private void btn13()
{
metin13 = $"{yeniProgram}";
}
private void btn14()
{
metin14 = $"{yeniProgram}";
}
private void btn15()
{
metin15 = $"{yeniProgram}";
}
private void btn16()
{
metin16 = $"{yeniProgram}";
}
private void btn17()
{
metin17 = $"{yeniProgram}";
}
private void btn18()
{
metin18 = $"{yeniProgram}";
}
private void btn19()
{
metin19 = $"{yeniProgram}";
}
private void btn20()
{
metin20 = $"{yeniProgram}";
}
private void btn21()
{
metin21 = $"{yeniProgram}";
}
private void btn22()
{
metin22 = $"{yeniProgram}";
}
private void btn23()
{
metin23 = $"{yeniProgram}";
}
private void btn24()
{
metin24 = $"{yeniProgram}";
}
private void btn25()
{
metin25 = $"{yeniProgram}";
}
private void btn26()
{
metin26 = $"{yeniProgram}";
}
private void btn27()
{
metin27 = $"{yeniProgram}";
}
private void btn28()
{
metin28 = $"{yeniProgram}";
}
private void btn29()
{
metin29 = $"{yeniProgram}";
}
private void btn30()
{
metin30 = $"{yeniProgram}";
}
private void btn31()
{
metin31 = $"{yeniProgram}";
}
private void btn32()
{
metin32 = $"{yeniProgram}";
}
private void btn33()
{
metin33 = $"{yeniProgram}";
}
private void btn34()
{
metin34 = $"{yeniProgram}";
}
private void btn35()
{
metin35 = $"{yeniProgram}";
}
private void btn36()
{
metin36 = $"{yeniProgram}";
}
private void btn37()
{
metin37 = $"{yeniProgram}";
}
private void btn38()
{
metin38 = $"{yeniProgram}";
}
private void btn39()
{
metin39 = $"{yeniProgram}";
}
private void btn40()
{
metin40 = $"{yeniProgram}";
}
}
}
\ No newline at end of file
@page "/"
@namespace haftalik.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = "_Layout";
}
<component type="typeof(App)" render-mode="ServerPrerendered" />
@using Microsoft.AspNetCore.Components.Web
@namespace haftalik.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
<link href="haftalik.styles.css" rel="stylesheet" />
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
</head>
<body>
@RenderBody()
<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.server.js"></script>
</body>
</html>
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using haftalik.Data;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddSingleton<WeatherForecastService>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
app.Run();
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:41279",
"sslPort": 44347
}
},
"profiles": {
"haftalik": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7099;http://localhost:5152",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
@inherits LayoutComponentBase
<PageTitle>haftalik</PageTitle>
<div class="page">
<div class="sidebar">
<NavMenu />
</div>
<main>
<div class="top-row px-4">
<a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
</div>
<article class="content px-4">
@Body
</article>
</main>
</div>
.page {
position: relative;
display: flex;
flex-direction: column;
}
main {
flex: 1;
}
.sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}
.top-row {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}
.top-row ::deep a, .top-row .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
}
.top-row a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
@media (max-width: 640.98px) {
.top-row:not(.auth) {
display: none;
}
.top-row.auth {
justify-content: space-between;
}
.top-row a, .top-row .btn-link {
margin-left: 0;
}
}
@media (min-width: 641px) {
.page {
flex-direction: row;
}
.sidebar {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}
.top-row {
position: sticky;
top: 0;
z-index: 1;
}
.top-row, article {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">haftalik</a>
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
<nav class="flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="oi oi-home" aria-hidden="true"></span> Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
<span class="oi oi-plus" aria-hidden="true"></span> Counter
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="fetchdata">
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
</NavLink>
</div>
</nav>
</div>
@code {
private bool collapseNavMenu = true;
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private void ToggleNavMenu()
{
collapseNavMenu = !collapseNavMenu;
}
}
.navbar-toggler {
background-color: rgba(255, 255, 255, 0.1);
}
.top-row {
height: 3.5rem;
background-color: rgba(0,0,0,0.4);
}
.navbar-brand {
font-size: 1.1rem;
}
.oi {
width: 2rem;
font-size: 1.1rem;
vertical-align: text-top;
top: -2px;
}
.nav-item {
font-size: 0.9rem;
padding-bottom: 0.5rem;
}
.nav-item:first-of-type {
padding-top: 1rem;
}
.nav-item:last-of-type {
padding-bottom: 1rem;
}
.nav-item ::deep a {
color: #d7d7d7;
border-radius: 4px;
height: 3rem;
display: flex;
align-items: center;
line-height: 3rem;
}
.nav-item ::deep a.active {
background-color: rgba(255,255,255,0.25);
color: white;
}
.nav-item ::deep a:hover {
background-color: rgba(255,255,255,0.1);
color: white;
}
@media (min-width: 641px) {
.navbar-toggler {
display: none;
}
.collapse {
/* Never collapse the sidebar for wide screens */
display: block;
}
}
<div class="alert alert-secondary mt-4">
<span class="oi oi-pencil me-2" aria-hidden="true"></span>
<strong>@Title</strong>
<span class="text-nowrap">
Please take our
<a target="_blank" class="font-weight-bold link-dark" href="https://go.microsoft.com/fwlink/?linkid=2149017">brief survey</a>
</span>
and tell us what you think.
</div>
@code {
// Demonstrates how a parent component can supply parameters
[Parameter]
public string? Title { get; set; }
}
@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using haftalik
@using haftalik.Shared
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment