Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

ASP .NET application and contextual awareness

  Asked By: Jeanne Campos         Date: Jul 17, 2008      Category: Sharepoint      Views: 531
 

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:

weblogs.asp.net/.../SharePoint-2007-_2D00_-_2F005F0\
0_layouts-and-how-to-create-pages-that-run-in-site-context.aspx

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

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)?

Tagged:            

 

7 Answers Found

 
Answer #1       Answered By: Rita Ingram          Answered On: Jul 17, 2008       

What URL are you using to access  the _layouts  content? If you are using
http://mysharepoint/sites/sitea/_layouts/ and have setup your Master
Page/CSS references correctly you should get the context and look/feel
you are after.

 
Answer #2       Answered By: Christian Waters          Answered On: Jul 17, 2008       

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
Pool?

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 #3       Answered By: Virendar Bahudur          Answered On: Jul 17, 2008       

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 #4       Answered By: Sierra Beck          Answered On: Jul 17, 2008       

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 #5       Answered By: Elisabeth Walsh          Answered On: Jul 17, 2008       

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 #6       Answered By: Bhavesh Doshi          Answered On: Jul 17, 2008       

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

 
Answer #7       Answered By: Elisa Santos          Answered On: Jul 17, 2008       

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.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].