<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Fahreza Bahran on Medium]]></title>
        <description><![CDATA[Stories by Fahreza Bahran on Medium]]></description>
        <link>https://medium.com/@fahrezabahran1?source=rss-8fc6acb62574------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*aot43TlhoKXlUg1w</url>
            <title>Stories by Fahreza Bahran on Medium</title>
            <link>https://medium.com/@fahrezabahran1?source=rss-8fc6acb62574------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:25:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fahrezabahran1/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[C: Full]]></title>
            <link>https://medium.com/@fahrezabahran1/c-full-62610f0a6540?source=rss-8fc6acb62574------2</link>
            <guid isPermaLink="false">https://medium.com/p/62610f0a6540</guid>
            <dc:creator><![CDATA[Fahreza Bahran]]></dc:creator>
            <pubDate>Tue, 09 Sep 2025 02:42:27 GMT</pubDate>
            <atom:updated>2025-09-09T02:42:27.224Z</atom:updated>
            <content:encoded><![CDATA[<pre>Get-ChildItem &quot;C:\Users\fahreza.bahran\AppData\Local&quot; -Directory | <br>    ForEach-Object {<br>        $size = (Get-ChildItem $_.FullName -Recurse -File -ErrorAction SilentlyContinue | <br>                 Measure-Object -Property Length -Sum).Sum<br>        [PSCustomObject]@{<br>            Folder = $_.FullName<br>            SizeGB = &quot;{0:N2}&quot; -f ($size/1GB)<br>        }<br>    } | Sort-Object {[double]$_.SizeGB} -Descending</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sH77qwNgQkPm0mstwXBVCw.png" /></figure><p>Example path : \Temp</p><p>Delete using PowerShell<br>Akan menghapus semua file/folder di dalam Temp, kecuali yang sedang dipakai.</p><pre>Remove-Item &quot;C:\Users\fahreza.bahran\AppData\Local\Temp\*&quot; -Recurse -Force -ErrorAction SilentlyContinue</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jRFBhEa72DFDmiIgzvGIFw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62610f0a6540" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Submit Form ASP NET Core MVC]]></title>
            <link>https://medium.com/@fahrezabahran1/submit-form-asp-net-core-mvc-cdd6b8d4ae7a?source=rss-8fc6acb62574------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdd6b8d4ae7a</guid>
            <category><![CDATA[asp-net-mvc]]></category>
            <category><![CDATA[aspnet]]></category>
            <category><![CDATA[aspnetcore]]></category>
            <dc:creator><![CDATA[Fahreza Bahran]]></dc:creator>
            <pubDate>Wed, 25 Jun 2025 02:42:06 GMT</pubDate>
            <atom:updated>2025-06-25T02:49:03.270Z</atom:updated>
            <content:encoded><![CDATA[<p>POST -&gt; REDIRECT -&gt; GET<br>Form submit full reload → validasi server → View balik render ulang.</p><p>🧠 Kenapa pakai Redirect (PRG Pattern)?<br>POST-Redirect-GET adalah best practice form submission di web tradisional.</p><ol><li>Mencegah form resubmission saat refresh.</li><li>Validasi gagal tetap bisa render form dengan error.</li><li>Validasi sukses akan redirect ke halaman baru (bisa success message).</li></ol><p>PersonCreate.cshtml</p><pre>@model PersonViewModel<br>@{<br>    ViewData[&quot;Title&quot;] = &quot;Form Input&quot;;<br>}<br><br>&lt;h2&gt;Form Input Nama dan Alamat&lt;/h2&gt;<br><br>@if (TempData[&quot;SuccessMessage&quot;] != null)<br>{<br>    &lt;div class=&quot;alert alert-success&quot;&gt;@TempData[&quot;SuccessMessage&quot;]&lt;/div&gt;<br>}<br><br>&lt;form asp-action=&quot;Create&quot; method=&quot;post&quot; class=&quot;mt-3&quot;&gt;<br>    &lt;div class=&quot;form-group&quot;&gt;<br>        &lt;label asp-for=&quot;Name&quot;&gt;&lt;/label&gt;<br>        &lt;input asp-for=&quot;Name&quot; class=&quot;form-control&quot; /&gt;<br>        &lt;span asp-validation-for=&quot;Name&quot; class=&quot;text-danger&quot;&gt;&lt;/span&gt;<br>    &lt;/div&gt;<br><br>    &lt;div class=&quot;form-group&quot;&gt;<br>        &lt;label asp-for=&quot;Address&quot;&gt;&lt;/label&gt;<br>        &lt;input asp-for=&quot;Address&quot; class=&quot;form-control&quot; /&gt;<br>        &lt;span asp-validation-for=&quot;Address&quot; class=&quot;text-danger&quot;&gt;&lt;/span&gt;<br>    &lt;/div&gt;<br><br>    &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary mt-3&quot;&gt;Simpan&lt;/button&gt;<br>&lt;/form&gt;</pre><p>PersonViewModel.cs</p><pre>public class PersonViewModel<br>{<br>    [Required(ErrorMessage = &quot;Nama wajib diisi&quot;)]<br>    public string Name { get; set; }<br><br>    [Required(ErrorMessage = &quot;Alamat wajib diisi&quot;)]<br>    public string Address { get; set; }<br>}</pre><p>PersonController.cs</p><pre>public class PersonController : Controller<br>{<br>    [HttpGet]<br>    public IActionResult Create()<br>    {<br>        return View(new PersonViewModel());<br>    }<br><br>    [HttpPost]<br>    public IActionResult Create(PersonViewModel model)<br>    {<br>        if (!ModelState.IsValid)<br>        {<br>            return View(model); // Validasi gagal: tampilkan error + data tetap ada<br>        }<br><br>        // Validasi sukses: simpan data dan redirect<br>        TempData[&quot;Success&quot;] = &quot;Data berhasil disimpan!&quot;;<br>        return RedirectToAction(&quot;SuccessResult&quot;);<br>    }<br><br>    [HttpGet]<br>    public IActionResult SuccessResult()<br>    {<br>        return View(&quot;Create&quot;, new PersonViewModel<br>        {<br>            IsSuccess = true,<br>            StatusMessage = &quot;Data berhasil dikirim.&quot;<br>        });<br>    }<br>}</pre><ol><li>Fisrt Load<br>GET :</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*DMVGO3-3GwF8sXk6LlAFig.png" /></figure><p>2. Submit Form when address empty<br>POST :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*o7Wn7dnroABkLkhGUIcEuQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*sZXKTxdpHGlhZyWtvJEpAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*MdKpAUaec5iTFSei5LYXzQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdd6b8d4ae7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>