SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to deploy an .aspx from visual studio, to a sharepoint subsite.

I can deploy it fine in the layout folder. How can i deploy it in a subsite so that it can be added in the quick link section ?

ps: I need an aspx for Ajax calls, this is why it doesnt work when using a webpart as they only contain ascx.

Thanks alot !


share|improve this question
Adding a customized .aspx within a SharePoint site itself brings more than a few headaches. Is there some functionality that is missing when the file is in _layouts that you need to deploy it to the site for? – Dave Wise Mar 5 '13 at 20:45
well it shows the masterpage as if it is in the root site, wich it is. I would need to change the master page. But then again its they exit the subsite when they get into the page under _layouts. Is there other way to call backend methods from Ajax ? – Dr.Denis McCracleJizz Mar 5 '13 at 21:00
up vote 1 down vote accepted

SharePoint supports a very wide variety of web services that can all be called via AJAX. However, those services are all called using the ID of the user, which is sometimes not desired. In those instances, you need to use a solution like it sounds like you are using already since pages running on the server can run either in the User context or in the context of the Application Pool. They can even run be configured to run under a completely different account if that is needed.

AJAX itself runs only on the client and doesn't know anything at all about the master page or where the master page resides. What you can do is put your ASPX page in _layouts then use javascript to determine the current site URL, add '/_layouts/AppName/CustomPage.aspx' to the URL and make your call. This works because '_layouts' is the same no matter which site you are in but calling it in this way allows your ASPX page to easily determine the current site context and respond accordingly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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