Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

ASP .NET application and contextual awareness

  Asked By: Jeanne    Date: Jul 17    Category: Sharepoint    Views: 1630

I am trying to develop an ASP .NET web application that resides within
SharePoint's _layouts directory. The application needs to context
aware, i.e. it needs to 1) display the navigation corresponding to the
site from which it is launched, and 2) it needs to obtain its data
from that site. I've been able to create an application that does
retain the look and feel of SharePoint by following the directions on
this blog:


That is, if I access the site from http://mysharepoint/sites/sitea/, I
should get a different Quick Launch bar and data from

The problem is, no matter where the page is launched from, I get the
same navigation and data: that of the "main" page (http://mysharepoint/).

Is it possible to get contextual data/navigation using this method
(copying a web application to SharePoint's _layouts directory)?



7 Answers Found

Answer #1    Answered By: Christian Waters     Answered On: Jul 17

I would like to do something similar, but have several questions:

a) Do the ASP.NET files have to be placed in the _layouts  directory, or
could they be in a separate IIS virtual directory  running under the same App

b) In the referenced article, the page  assumes the context of the calling
page. Is there any way to specify a certain context, no matter where it is
called from?

c) How do you control access  to the page? Some of the pages that I need to
create must be strictly controlled through SharePoint groups and/or
individual users.

Answer #2    Answered By: Virendar Bahudur     Answered On: Jul 17

The way I have it running is they are located in the SharePoint
layouts directory  referenced in the article (C:\Program Files\Common
Files\Microsoft Shared\...).

Question B is the question that I was asking myself; it seems as if no
matter where I'm accessing the site, whether it be the root or a
subsite, I get the same context.
I am using "~/_layouts/application.master" as my master page  file.

As for Question C, I am not sure, I haven't gotten that far yet and
this app doesn't require strict permissions (yet).

Answer #3    Answered By: Sierra Beck     Answered On: Jul 17

For question B, what is the actual URL you are using to access  the
custom page  - is it something like
http://mysharepoint/sites/sitea/_layouts/custompage.aspx or
http://mysharepoint/_layouts/custompage.aspx? The former will give you
context, the latter will not.

Answer #4    Answered By: Elisabeth Walsh     Answered On: Jul 17

Is it possible to place custom apps somewhere like
http://mysharepoint/sites/apps/app1 , which would map to a separate virtual
directory under IIS, using the same App Pool as SharePoint?

I want to segregate the ASP.NET apps from the server file structure, yet be
able to inherit master pages, CSS, permissions, etc. In other words, the
ASP.NET pages would look and feel  just like the sharepoint  pages, but with
custom content.

Answer #5    Answered By: Bhavesh Doshi     Answered On: Jul 17

I just realized my problem, I was accessing the page  via
http://mysharepoint/sites/sitea/_layouts/app/ instead of

Answer #6    Answered By: Elisa Santos     Answered On: Jul 17

I'll be sure to post what I find out.

Didn't find what you were looking for? Find more on ASP .NET application and contextual awareness Or get search suggestion and latest updates.