c3stream/Pages/Index.cshtml

27 lines
1.5 KiB
Plaintext

@page
@using Microsoft.AspNetCore.Http
@model IndexModel
@{
ViewData["Title"] = "Home";
if (Request.Query.ContainsKey("bookmark") && HttpContext.Session.GetString("bookmark") != Request.Query["bookmark"]) {
HttpContext.Session.SetString("bookmark", Request.Query["bookmark"]);
}
if (!HttpContext.Session.Keys.Contains("bookmark") || !Guid.TryParseExact(HttpContext.Session.GetString("bookmark"), "D", out _)) {
HttpContext.Session.SetString("bookmark", Guid.NewGuid().ToString());
}
if (!Request.Query.ContainsKey("bookmark") || HttpContext.Session.GetString("bookmark") != Request.Query["bookmark"]) {
Response.Redirect("/?bookmark=" + HttpContext.Session.GetString("bookmark"));
}
}
<div style="text-align: center">
<h1>Welcome to c3stream!</h1>
Your bookmark link:<br/>
<code>@c3stream.MainUrl?bookmark=@HttpContext.Session.GetString("bookmark")</code><br/><br/>
<div class="btn-group">
<a type="button" class="btn btn-primary" href="/Conference?c=36c3&bookmark=@HttpContext.Session.GetString("bookmark")">36c3</a>
<a type="button" class="btn btn-primary" href="/Conference?c=35c3&bookmark=@HttpContext.Session.GetString("bookmark")">35c3</a>
<a type="button" class="btn btn-primary" href="/Conference?c=34c3&bookmark=@HttpContext.Session.GetString("bookmark")">34c3</a>
<a type="button" class="btn btn-primary" href="/Conference?c=33c3&bookmark=@HttpContext.Session.GetString("bookmark")">33c3</a>
</div>
</div>