![](/img/trans.png)
[英]How to massage data before redirect to another web application in asp.net core 2.0
[英]How to pass data to another .Net Core web application using post
我有一個用例,我需要重定向到另一個 Web 應用程序,但將一些字符串數據傳遞給它。 做這個的最好方式是什么? 我應該使用查詢字符串還是控制器代碼將數據存儲在 Web 瀏覽器中 - 不確定如何在 .Net 中執行此操作。 下面我想將 urlToReturn 發送到我要重定向到的應用程序:
[HttpPost]
public IActionResult Index()
{
string urlToReturn = "http://consumingapp.com";
return Redirect("https://ComponentApp.azurewebsites.net";
}
你的意思是這樣的:
[HttpPost]
public IActionResult Index()
{
string urlToReturn = "http://consumingapp.com";
return Redirect($"https://ComponentApp.azurewebsites.net?redirectTo={urlToReturn}";
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.