Tag Info

Hot answers tagged

12

You can create a feature and on the activation of the feature you can add the webpart to the page. public override void FeatureActivated(SPFeatureReceiverProperties properties) { SPSite site = properties.Feature.Parent as SPSite; using(SPWeb web = site.OpenWeb()) { using(SPLimitedWebPartManager wpManager = ...


12

You have to instantiate new SPSite and SPWeb objects inside your RunWithElevatedPrivileges() delegate using the ID properties of the current context's SPSite and SPWeb objects: Guid siteId = SPContext.Current.Site.ID; Guid webId = SPContext.Current.Web.ID; SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(siteId)) { ...


11

Let me see if I can explain pages in SharePoint without making you even more confused. The difference between the different kind of pages very much depend on whether your view is as developer or as end user. As you're refering to MSDN I'll start with the developer view. SharePoint Pages from a developer point of view From a developer point of view there ...


9

You can use webparts on your application page. They won't be customizable then, but they are put on the page as webcontrols: register your namespace that your webpart resides in: <%@ Register TagPrefix="prefix" Namespace="YourNameSpace" Assembly="Assembly" %> Then add your webcontrol by using the following code: <prefix:WebPartClassName ID="ID" ...


9

Admin Pages: Admin pages are typically used to extend central administration functionality and links to such pages are given in central administration site. Central Admin Web site uses a virtual directory named /_admin that is similar to the /_layouts virtual directory of content sites. The administrative virtual directory is mapped physically to the ...


8

My general rule of thumb on application page versus web part is re-usabilty...i.e. do I need to surface the capability in more than one location within a site. If I'm only going to surface a single instance of the functionality then surfacing that capability via an application page is the way to go because they are much easier to build, deploy, and maintain ...


8

I suppose the attraction of application pages is that they are much closer to being a "normal" aspx page. You say you are building what is, in effect, an aspx application on top of SharePoint. If this is a custom application that you do not anticipate re-using, and it doesn't need to be modular or modifiable by users, then maybe application pages are the ...


8

One important thing is the performance aspect! Application pages are compiled when first accessed whereas site pages are not compiled. Another important aspect is that Site Pages does only support controls marked as SafeControls and inline code is not possible (without fiddling with security).


6

No, that's not possible in SharePoint, application pages should be in the _layouts folder (or _admin for application pages for central admin). You can put pages as http://localhost/MyCustomDirectory/MyCustomApplicationPage.aspx, but then they should be site pages, which you provision using a "Module" element from Visual Studion. But be aware that then users ...


6

SharePoint will store the full copy of any document/page for each version of that document/page. In some cases (as with Wiki pages), SharePoint will highlight content to show what changed from version to version, but with documents and pages, the entire file is stored in the content database. This is why storing multiple different versions of large documents ...


6

Code below should do the trick Page.Request.RawUrl


5

Placing webparts to application pages (i.e. within _layouts folder) actually is not a very good idea, especially when it comes to OOTB SharePoint webparts. Personally, I'd prefer to avoid this, because although it's possible, but AFAIK it is not officially supported by Microsoft and there are some known issues, for example I can recall the ...


5

ExecuteOrDelayUntilScriptLoaded(function () { var pageStateGroupPublishValue = SP.Ribbon.PageState.PageStateCommands.pageStateGroupSubmitForApproval; SP.Ribbon.PageManager.get_instance().executeRootCommand(pageStateGroupPublishValue, window.g_CUIcommandProperties, { CommandId: pageStateGroupPublishValue }, null); }, "sp.ribbon.js");


5

Of course there is! Go to http://mysite.com/_Layouts/AreaWelcomePage.aspx and change the URL. Or via the UI: Site actions > Site Settings > User Interface > Welcome Page and change the URL. Update I just tried myself and I see that none of them work. It seems like that the page has to reside in the content database and not just the domain. I found a ...


5

SharePoint always stores the full file. It never tries to do diffs. I haven't seen it documented regarding Site pages anywhere but if you ON A DEV BOX tries this: Create a new Team site with relative url "Team" Modify Home.aspx in SharePoint Designer Turn on Major/minor versioning of "Site Pages" Check out Home.aspx Modify Home.aspx in SharePoint Designer ...


5

Get the relevant Publishing web which contains GetAvailablePageLayouts, and find the one which you should use to create your page. See sample code: PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web); string pageName = "YourCustomPageLayout.aspx"; PageLayout[] pageLayouts = publishingWeb.GetAvailablePageLayouts(); PageLayout ...


4

How would rssbus help? Does it replicate between SharePoint Lists and normalized databases? Why not spin up SP2010 farm now and leverage BCS now? Be careful as normalized db's means most likely custom BDC model in Visual Studio 2010 to manage the mapping. Also BCS External Content Type List doesn't support everything a standard list does.


4

Thanks, it helped us a lot..saved a lot of time. Great answer :) From SPSecurity.RunWithElevatedPrivileges: "An SPSite object created outside the delegate can be referenced inside the delegate, however, the methods and property assessors of the object run with the privileges of the user context in which the objects were created, not with the elevated ...


4

You'd have to use something like .NET Reflector and its Visual Studio plugin in order to actually step through the code in the debugger. With something like ILSpy you can take a look at the code, but not step through it, which may well be enough to discover what's going wrong without spending money.


4

I would check the ULS logs with a tool like the ULS Viewer. Start a trace, load the page again and check the viewer. It may reveal more details about what's happening to cause the problem. Here's a link: http://archive.msdn.microsoft.com/ULSViewer


4

I prefer to use following: SPUtility.GetServerRelativeUrlFromPrefixedUrl("~sitecollection/_layouts/sc/page.aspx") SPUtility.GetServerRelativeUrlFromPrefixedUrl("~site/_layouts/sc/page.aspx") First one for site collection relative url and the other one for site relative url.


4

Using firebug (or chrome or ie dev tools) check if your redirect button redirects you to correct address. (For example you may expect that it redirects to http://mysite/sites/cars/_layouts/myApplicationPage.aspx, but it actually redirects to http://mysite/_layouts/myApplicationPage.aspx where you get access denied). And also (this is not an answer, but ...


4

You need to create a custom action with right location. In your case it should be: <CustomAction Id="MyNewPage" GroupId="SiteCollectionAdmin" Location="Microsoft.SharePoint.SiteSettings" Sequence="40" Title="My new page" Description="Description"> <UrlAction Url="_layouts/mynewpage.aspx" /> ...


4

Application pages are not allowed in Sandboxed solutions. So all pages have to be site pages, deployed through modules. These modules can then be added to features which can be activated on the difference sites depending on which pages is needed on each site.


4

I created three web parts connected together and filterable using Title: Choose a color -> Choose a fruit -> View fruit details. I created the following selector (jQuery required): $('img[alt="Selected"]').parent().next().children('div.ms-vb'); Which returns an array of the selected elements which have an ID attribute. You could then do a simple each ...


4

Would this not work? Using the fact that Layouts is shared through the fram targetUrl = '/_layouts/MyProject/AppPage.aspx' + "?Location=" + window.location.href; or you could try: targetUrl = SP.Utilities.Utility.getLayoutsPageUrl('MyProject/AppPage.aspx' + "?Location=" + window.location.href)


3

I don't think you can reference it statically like that. Try this instead: <h2><asp:Literal runat="server" ID="Literal1" Text="<%$Resources:MyProject,Test_String_Heading%>"></asp:Literal></h2> EDIT: it's $Resources versus &Resources. Thanks for picking that up Bojan! UPDATE: As noted below the $Resources method of ...


3

Sounds like you want the PeopleEditor control. If you google around, you'll see some examples of it in use in an aspx page, but the principles are the same, it's just a .NET control.


3

I guess there will be ok to run Powershell from SharePoint, but why will you not use managed code for this? Powershell is great for scripting, but most of the commands can also be found in managed code. The Microsoft.SharePoint.Administration.SPDeveloperDashboardSettings class can help. SPDeveloperDashboardSettings settings = ...


3

TMS included the Business Data Connector (BDC) and Burliness Connectivity Services (BCS) to assist with such scenarios. Some good overview: http://technet.microsoft.com/en-us/library/ee661740.aspx http://www.lightningtools.com/bcs/Business-Connectivity-Services-Introduction.aspx Coincidentally (not really) lightingtools make some cool BDC/BCS tools for ...



Only top voted, non community-wiki answers of a minimum length are eligible