Redirect to external URI from ASP.NET MVC controller

前端 未结 4 1058
Happy的楠姐
Happy的楠姐 2020-11-27 13:52

I\'m trying to redirect to external url from an action method but can\'t get it to work. Can anybody shed some light on my error?

public void ID(string id)
          


        
4条回答
  •  半阙折子戏
    2020-11-27 14:15

    Using JavaScript

     public ActionResult Index()
     {
        return Content("");
     }
    

    Note: As @Jeremy Ray Brown said , This is not the best option but you might find useful in some situations.

    Hope this helps.

提交回复
热议问题