Relative URL in JQuery Post Call

前端 未结 7 1852
终归单人心
终归单人心 2021-01-30 17:22

I have the following situation.

I developed my first MVC Asp.Net application. it runs on my server at the following adress

http://localhost:59441/
         


        
7条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-30 17:57

    Pass @Url.Action("action","controller") to the javascript from the view. This will allow it to be update dynamically at run time.

    
    

    There may be a function to get the root path also which you could use to initialize the root variables in the previous answers.

提交回复
热议问题