0

I was working on my project normally, doing deploy of the solution, but in a moment, after of last deploy, the URL of the solution was changed, the correct URL solution is "...sites/dev/SitePages/App/Pages/default.aspx" but after of the last deploy the URL change to*"...sites/dev/SitePages/App2/Pages/default.aspx"*, adding "2" in the solution name (App2).

I don't know what to do, I did not touch the URL in my code, I just added a new line of code, but I don't rename the solution name or something like that.

0

Try this, in the master page

<script>
        var arrayUrl = _spPageContextInfo.webServerRelativeUrl.split('/');
        var siteUrl = arrayUrl[arrayUrl.length - 1];
</script>

Use that, and replace all "App Name" for "siteUrl" variable

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.