<body> <div id="data"> data goes here: @ViewBag.Paramater </div> <script> $(document).ready(function () { var urlPath = top.document.location.href axios.post('/something/CustomPages/62502599-ac48-42b9-b4bf-b211d0341317/Home/Data', { urlValue: urlPath }) .then(function (response) { document.getElementById("data").innerHTML = response.data; }) .catch(function (error) { console.log(error); }); }); </script> </body>
Here is what I tried: <pre>[HttpPost] public ActionResult Index() { return View();//this use js to get the url } [HttpPost] public ActionResult Data(string urlValue) { //How to pass the url to this Action Uri mainURL = new Uri(Request.Form["urlValue"]); //here is the issue var artifacrID = HttpUtility.ParseQueryString(mainURL.Query).Get("ArtifactID"); int DocumentArtifact = Convert.ToInt32(artifacrID);
Uri mainURL = new Uri(Request.Form["urlValue"]); //here is the issue
Uri mainURL = new Uri(urlValue);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)