{"id":712,"date":"2023-07-19T11:48:54","date_gmt":"2023-07-19T02:48:54","guid":{"rendered":"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=712"},"modified":"2023-08-07T10:08:23","modified_gmt":"2023-08-07T01:08:23","slug":"blazor%e3%81%a7%e3%81%ae%e7%94%bb%e9%9d%a2%e9%81%b7%e7%a7%bb%e6%96%b9%e6%b3%95%e3%81%aa%e3%81%a9","status":"publish","type":"post","link":"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=712","title":{"rendered":"blazor\u3067\u306e\u753b\u9762\u9077\u79fb\u65b9\u6cd5\u306a\u3069"},"content":{"rendered":"\n<p>\u6700\u8fd1\u3001Blazor(Server Side)\u3067\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u3044\u3066\u3001\u30c1\u30e7\u30c3\u30c8\u3070\u304b\u308a\u8abf\u3079\u305f\u3082\u306e\u304c\u3042\u308b\u306e\u3067\u3001\u5099\u5fd8\u9332\u3068\u3057\u3066\u3002<\/p>\n\n\n\n<p>\u307e\u305a\u3001\u30ea\u30f3\u30af\u3092\u4f7f\u7528\u305b\u305a\u306b\u3001\u30dc\u30bf\u30f3\u30a4\u30d9\u30f3\u30c8\u7b49\u3067\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u4ed6\u30da\u30fc\u30b8\u306b\u753b\u9762\u9077\u79fb\u3055\u305b\u308b\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u306b\u306f\u3001<code><strong>NavigationManager<\/strong><\/code>\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3059\u308b\u3002<code><strong>NavigationManager<\/strong><\/code>\u30af\u30e9\u30b9\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u3001\u30b5\u30fc\u30d3\u30b9\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001<code><strong>inject<\/strong><\/code>\u3057\u3066\u4f7f\u7528\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-razor\" data-file=\"Blazor\u30da\u30fc\u30b8\u9077\u79fb\" data-lang=\"RazorPage\"><code>@page &quot;\/&quot;\n\u30fb\u30fb\u30fb\n@inject NavigationManager Navi\n\u30fb\u30fb\u30fb\n&lt;button class=&quot;btn btn-primary&quot; @onclick=&quot;GotoNext&quot;&gt;\u6b21\u30da\u30fc\u30b8&lt;\/button&gt;\n@code {\n\t\u30fb\u30fb\u30fb\n\tprotected void GotoNext() {\n\t\t\/\/ Next\u30da\u30fc\u30b8\u3078\u9077\u79fb\n\t\tNavi.NavigateTo(&quot;.\/Next&quot;);\n\t}\n\t\u30fb\u30fb\u30fb\n}<\/code><\/pre><\/div>\n\n\n\n<p>\u304a\u6b21\u306f\u3001Blazor\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3078URL\u30d9\u30fc\u30b9\u3067\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6e21\u3059\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>URL\u306e\u4e00\u90e8\u3092\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u6e21\u3059\u306b\u306f\u3001page\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3057\u3001\u30b3\u30fc\u30c9\u90e8\u3067\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u5b9a\u7fa9\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-razor\" data-file=\"URL\u306e\u4e00\u90e8\u3068\u3057\u3066\u30d1\u30e9\u30e1\u30fc\u30bf\u53d7\u3051\u53d6\u308a\" data-lang=\"RazorPage\"><code>@page &quot;\/Edit\/{UserID?}&quot;\n\u30fb\u30fb\u30fb\n@code {\n\t\u30fb\u30fb\u30fb\n\t[Parameter]\n\tpublic string? UserID { get; set; }\n\t\u30fb\u30fb\u30fb\n}<\/code><\/pre><\/div>\n\n\n\n<p><code><strong>.\/Edit\/User001<\/strong><\/code>\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u547c\u3073\u51fa\u3059\u3068\u3001UserID\u306b&#8221;User001&#8243;\u304c\u30bb\u30c3\u30c8\u3055\u308c\u308b\u3002<\/p>\n\n\n\n<p>\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u6e21\u3059\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-razor\" data-file=\"\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u53d7\u3051\u53d6\u308a\" data-lang=\"RazorPage\"><code>@page &quot;\/Edit&quot;\n\u30fb\u30fb\u30fb\n@code {\n\t[Parameter]\n\t[SupplyParameterFromQuery]\n\tpublic string? UserID {get; set;}\n}<\/code><\/pre><\/div>\n\n\n\n<p><code><strong>.\/Edit?UserID=User001<\/strong><\/code>\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u547c\u3073\u51fa\u3059\u3002<\/p>\n\n\n\n<p>\u610f\u5916\u3068\u5fd8\u308c\u305d\u3046\u306a\u306e\u3067\u3001\u30e1\u30e2\u3057\u3068\u304f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u3001Blazor(Server Side)\u3067\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u3044\u3066\u3001\u30c1\u30e7\u30c3\u30c8\u3070\u304b\u308a &hellip; <a href=\"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=712\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,12,10,9,4],"tags":[],"class_list":["post-712","post","type-post","status-publish","format-standard","hentry","category-net","category-asp-net-core","category-blazor","category-c","category-4"],"_links":{"self":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/712","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=712"}],"version-history":[{"count":7,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/712\/revisions"}],"predecessor-version":[{"id":740,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/712\/revisions\/740"}],"wp:attachment":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}