2020年12月23日 星期三

dotnet core redirect

 1. Good

ref: https://www.dotnettricks.com/learn/mvc/return-view-vs-return-redirecttoaction-vs-return-redirect-vs-return-redirecttoroute

ASP.NET MVC - View() vs RedirectToAction() vs Redirect() Methods



The Redirect() Method

This method is used to redirect to specified URL instead of rendering HTML. In this case, the browser receives the redirect notification and make a new request for the specified URL. This also acts like Response.Redirect() in Asp.Net WebForm. In this case, you have to specify the full URL to redirect.


Moreover, Redirect also cause the browser to receive a 302 redirect within your application, but you have to construct the URLs yourself.


public ActionResult Index()

{

 return View();

}


[HttpPost]

public ActionResult Index(string Name)

{

 ViewBag.Message = "Hi, Dot Net Tricks";

 //Like Response.Redirect() in Asp.Net WebForm

 return Redirect("Home/MyIndex");

}


public ActionResult MyIndex()

{

 ViewBag.Msg = ViewBag.Message; // Assigned value : Null

 return View("MyIndex");

############################################################################

############################################################################

2. How to redirect a request in ASP.NET Core MVC


Redirect("/Author/Index");
RedirectPermanent("/Author/Index");
RedirectPermanentPreserveMethod("/Author/Index");
RedirectPreserveMethod("/Author/Index");

2020年12月1日 星期二

iptables

 http://163.20.160.24/~pc/modules/tadnews/index.php?nsn=58


https://stevenitlife.blogspot.com/2020/01/k8s-cluster.html


https://mileslin.github.io/2019/05/%E7%9E%AD%E8%A7%A3-Docker-%E7%9A%84%E9%A0%90%E8%A8%AD%E7%B6%B2%E8%B7%AF%E8%A8%AD%E7%BD%AE/


http://linux.vbird.org/linux_server/0250simple_firewall.php


https://blog.jangmt.com/2015/09/centos7-firewalld-iptables.html


https://www.itread01.com/content/1541339230.html


https://blog.gtwang.org/linux/centos-7-firewalld-command-setup-tutorial/


https://www.hwchiu.com/iptables-1.html


https://www.digitalocean.com/community/tutorials/how-to-list-and-delete-iptables-firewall-rules