{"id":608,"date":"2023-01-16T11:55:07","date_gmt":"2023-01-16T02:55:07","guid":{"rendered":"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=608"},"modified":"2023-01-30T15:46:36","modified_gmt":"2023-01-30T06:46:36","slug":"bootstrap%e3%83%a2%e3%83%bc%e3%83%80%e3%83%ab%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%81%a8blazor","status":"publish","type":"post","link":"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=608","title":{"rendered":"bootstrap\u30e2\u30fc\u30c0\u30eb\u30c0\u30a4\u30a2\u30ed\u30b0\u3068blazor"},"content":{"rendered":"\n<p>bootstrap\u3067\u306f\u3001\u6a19\u6e96\u3067\u30e2\u30fc\u30c0\u30eb\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3001div\u30bf\u30b0\u3078\u7279\u5b9a\u306eCSS\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3059\u308b\u3060\u3051\u3067\u3001\u7c21\u5358\u306b\u30e2\u30fc\u30c0\u30eb\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-csharp\" data-file=\"RazorPage\" data-lang=\"C#\"><code>&lt;button class=&quot;btn btn-primary&quot; data-toggle=&quot;modal&quot; data-target=&quot;#Modal&quot;&gt;\u30e6\u30fc\u30b6\u30fc\u9078\u629e&lt;\/button&gt;\n&lt;br\/&gt;\n&lt;span style=&quot;color:red;font-weight:bold&quot;&gt;@mesg&lt;\/span&gt;\n&lt;!-- \u30e2\u30fc\u30c0\u30eb\u672c\u4f53 --&gt;\n&lt;div class=&quot;modal fade&quot; id=&quot;Modal&quot; tabindex=&quot;-1&quot; role=&quot;dialog&quot; aria-labelledby=&quot;exampleModalCenterTitle&quot; aria-hidden=&quot;true&quot;&gt;\n\t&lt;div class=&quot;modal-dialog modal-dialog-centered&quot; role=&quot;document&quot;&gt;\n\t\t&lt;div class=&quot;modal-content&quot;&gt;\n\t\t\t&lt;!-- \u30e2\u30fc\u30c0\u30eb\u30d8\u30c3\u30c0\u90e8 --&gt;\n\t\t\t&lt;div class=&quot;modal-header&quot; style=&quot;background-color:navy;color:white&quot;&gt;\n\t\t\t\t&lt;h5 class=&quot;modal-title&quot; id=&quot;exampleModalLongTitle&quot;&gt;Modal Test&lt;\/h5&gt;\n\t\t\t\t&lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot; aria-label=&quot;Close&quot;&gt;\n\t\t\t\t  &lt;span aria-hidden=&quot;true&quot;&gt;\u00d7&lt;\/span&gt;\n\t\t\t\t&lt;\/button&gt;\n\t\t\t&lt;\/div&gt;\n\t\t\t&lt;!-- \u30e2\u30fc\u30c0\u30eb\u30dc\u30c7\u30a3 --&gt;\n\t\t\t&lt;div class=&quot;modal-body&quot; style=&quot;height:500px&quot;&gt;\n\t\t\t@if (Employees != null) {\n\t\t\t\t&lt;select size=&quot;20&quot; style=&quot;width:200px&quot; @bind=&quot;selectedEmpNo&quot;&gt;\n\t\t\t\t\t@foreach(var itm in Employees) {\n\t\t\t\t\t  &lt;option value=&quot;@itm.EmpNo&quot;&gt;@itm.Name&lt;\/option&gt;\n\t\t\t\t\t}\n\t\t\t\t&lt;\/select&gt;\n\t\t\t}\n\t\t\t&lt;\/div&gt;\n\t\t\t&lt;!-- \u30e2\u30fc\u30c0\u30eb\u30d8\u30c3\u30c0 --&gt;\n\t\t\t&lt;div class=&quot;modal-footer&quot;&gt;\n\t\t\t\t&lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; @onclick=&quot;OnCancelClick&quot;&gt;\u30ad\u30e3\u30f3\u30bb\u30eb&lt;\/button&gt;\n\t\t\t\t&lt;button type=&quot;button&quot; class=&quot;btn btn-primary&quot; @onclick=&quot;OnOKClick&quot;&gt;\u9078\u629e&lt;\/button&gt;\n\t\t\t&lt;\/div&gt;\n\t\t&lt;\/div&gt;\n\t&lt;\/div&gt;\n&lt;\/div&gt;<\/code><\/pre><\/div>\n\n\n\n<p>blazor\u3067\u3082\u4ee5\u4e0b\u306escript\u3092\u8aad\u8fbc\u3093\u3067\u304a\u3051\u3070\u3001\u4f7f\u7528\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-html\" data-file=\"script\u8aad\u8fbc\u307f\" data-lang=\"HTML\"><code>&lt;script src=&quot;https:\/\/code.jquery.com\/jquery-3.3.1.slim.min.js&quot; integrity=&quot;sha384-q8i\/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;\/script&gt;\n&lt;script src=&quot;https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/popper.js\/1.14.6\/umd\/popper.min.js&quot; integrity=&quot;sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ\/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;\/script&gt;\n&lt;script src=&quot;https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.2.1\/js\/bootstrap.min.js&quot; integrity=&quot;sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U\/mkkaduKaBhlAXv9k&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;\/script&gt;<\/code><\/pre><\/div>\n\n\n\n<p>\u30e2\u30fc\u30c0\u30eb\u306e\u30af\u30ed\u30fc\u30ba\u3092Javascript\u304b\u3089\u660e\u793a\u7684\u306b\u884c\u306a\u3046\u306b\u306f\u3001modal(&#8216;hide&#8217;)\u3092\u4f7f\u7528\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-js\" data-file=\"\u30e2\u30fc\u30c0\u30eb\u64cd\u4f5cJS\" data-lang=\"JavaScript\"><code>var modalope = {\n    close: (target) =&gt; {\n        var eleid = &#39;#&#39; + target;\n        $(eleid).modal(&#39;hide&#39;);\n    },\n    open: (target) =&gt; {\n        var eleid = &#39;#&#39; + target;\n        $(eleid).modal();\n    }\n};<\/code><\/pre><\/div>\n\n\n\n<p>\u4ee5\u4e0b\u306fblazor\u306ecode\u90e8\u5206<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-csharp\" data-file=\"\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\" data-lang=\"C#\"><code>@code {\n\tprotected string mesg = &quot;&quot;;\n\tprotected string selectedEmpNo = &quot;&quot;;\n\tprotected List&lt;Employee&gt; Employees = null!;\n\t\t\u30fb\u30fb\u30fb\n\tprotected async Task OnOKClick() {\n\t\tawait JS.InvokeVoidAsync(&quot;modalope.close&quot;,&quot;Modal&quot;);\n\t\tvar emp = Employees.Where(v=&gt;v.EmpNo == selectedEmpNo).FirstOrDefault();\n\t\tif (emp != null) {\n\t\t  mesg = $&quot;\u300c{emp.EmpNo}:{emp.Name}\u300d\u304c\u9078\u629e\u3055\u308c\u305f\u3088!!&quot;;\n\t\t}\n\t}\n\tprotected async Task OnCancelClick() {\n\t\tawait JS.InvokeVoidAsync(&quot;modalope.close&quot;,&quot;Modal&quot;);\n\t\tmesg = &quot;\u9078\u629e\u304c\u30ad\u30e3\u30f3\u30bb\u30eb\u3055\u308c\u305f\u3088!!&quot;;\n\t}\n\t\u30fb\u30fb\u30fb\n}<\/code><\/pre><\/div>\n\n\n\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u3053\u3093\u306a\u611f\u3058<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"703\" src=\"https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal1-1024x703.png\" alt=\"\" class=\"wp-image-614\" srcset=\"https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal1-1024x703.png 1024w, https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal1-300x206.png 300w, https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal1-768x527.png 768w, https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal1-1536x1054.png 1536w, https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal1.png 1902w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">\u5b9f\u884c\u753b\u97621<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"703\" src=\"https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal2-1024x703.png\" alt=\"\" class=\"wp-image-615\" srcset=\"https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal2-1024x703.png 1024w, https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal2-300x206.png 300w, https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal2-768x527.png 768w, https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal2-1536x1054.png 1536w, https:\/\/sumomo.ohwaki.jp\/wordpress\/wp-content\/uploads\/2023\/01\/modal2.png 1902w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">\u5b9f\u884c\u753b\u97622<\/figcaption><\/figure>\n\n\n\n<p>\u3082\u3061\u308d\u3093\u3001div\u306eid\u3092\u5909\u3048\u308c\u3070\u3001\u8907\u6570\u306e\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3002<\/p>\n\n\n\n<p>\u7d50\u69cb\u4fbf\u5229\u306b\u4f7f\u3048\u305d\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>bootstrap\u3067\u306f\u3001\u6a19\u6e96\u3067\u30e2\u30fc\u30c0\u30eb\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306a &hellip; <a href=\"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=608\">\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-608","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\/608","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=608"}],"version-history":[{"count":8,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/608\/revisions"}],"predecessor-version":[{"id":636,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/608\/revisions\/636"}],"wp:attachment":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}