Does SharePoint Online (Office 365 Cloud) support inline code blocks? SharePoint Designer code view? - sharepoint

Will we be able to add .NET code blocks to a page in SharePoint 365 - the cloud version of SharePoint? If so, how do we allow code blocks in the web.config?
Will we be able to use SharePoint designer to customize forms and create dataviews with external datasources?
Can we have asp.net codebehind files and class references? (I suspect not)

.NET code blocks (server-side scripts) are not supported in Office 365. You should build your ASPX page purely from controls and web parts, which would contain the code. Solutions for the SharePoint Online share their restrictions with sandboxed solutions for SharePoint 2010. The solution scope is a site collection; not a web application and thus you cannot access the web.config. However, you may not need to; you're bound only to a single site collection and the most usual task - adding SafeControls - is supported, although the SharePoint engine does not use web.config to maintain them. You can see an example of deploying a web part.
You can use the Designer to customize pages, forms and views. External data sources (entity types) - BCS - were added to SharePoint Online by the end of the last year. I haven't checked what connector types are supported; I presume SQL and WS sources, at least.
You cannot have the code-behind in ASPX pages. There is no ASP.NET compilation of pages and user controls available; that's why you have to compose your pages of coded controls and web parts only. However, there is a trick to circumvent this - the Visual Web Part. The original visual web part could not be used in a sandboxed solution because it relied on the ASP.NET compilation. There is a template available in Visual Studio 2010 SharePoint Power Tools that packages pre-compiled code to the solution and is friendly to the sandbox.
You can develop and test your sandboxed solutions on your local SharePoint 2010 prior deploying them to the SharePoint Online. Although I was surprised that deployng a solution to the SharePoint Online was kind of faster than to my local farm :-) MSVS makes the development really comfortable.
--- Ferda

Not being a .NET developer, here is my limited knowledge. Office 365 is a multi-tenant implementation of SharePoint and you you should have the following capabilities:
upload code blocks as sandboxed solutions
ability to customize forms and data views with SharePoint Designer
Note that Office 365 offers 30 day trials that would allow you to test drive it. Let me know if you need more details as there are a couple caveats to be aware of when you start a trial.

This question relates to how to implement what Mr Prantl suggested.
Where to write C# code for office365 sharepoint site
Hope this helps.

Related

Using SharePoint Designer to design a SharePoint 365 (online) site?

I'm new to SharePoint development and design. Someone recommended using SharePoint Designer as a quicker way to have the site have a specific look that is different from the SharePoint Look Book. We want sections of our page to have borders with rounded edges, and specific color headers. I found several contradicting articles about using SharePoint Designer. Do you recommend using it on the latest version of SharePoint online in 2022? Have you had any success, or have you encountered any issues?
I enable scripting on my site. I tried connecting SharePoint Designer 2013 to my SharePoint online site successfully, but would like to know if it's a good idea to move forward with it.
As you can read from here SP Designer is supported on the latest On-Premises version of SharePoint(2019) on the bare minimum. But as you can see it is a product that is steadily heading to it's end-of-support/deprecation lifecycle.
Also, as you can understand, since it's development was halted since the 2013 version, a lot have changed since then, and many of the new features are not even supported by SP Designer.
If your are trying to make modifications to a SharePoint Online site, I would suggest using more modern tools(PowerApps, Power Automate, Modern UI, SPFx etc) and leaving SP Designer to it's way to deprecation.
You can also, update your question in terms of what you are trying to achieve and we could propose you some ideas :)

Custom SharePoint List forms in SharePoint Framework

We are migrating old SharePoint 2010 On Premise code to SharePoint Online.
Part of the SharePoint 2010 on premise code has custom list forms developed with visual Studio.
Thought of using JSLink for custom forms while migrating the code to SharePoint Online but it seems that JSLink is only supported in classic experience and not in modern new experience.
Is there any way we can develop custom list forms on SharePoint Online with modern new experience? Is it possible with SharePoint Framework?
Note:
Tried by adding forms to list instances on SharePoint Hosted Add In but it targets the AppWeb lists and not the lists on HostWeb.
Well you can use react in modern web part to build any custom form. We can reuse components.
Another option is to use Power Apps similar to info path to design and add validation on list form.
https://abdulazizfarooqi.wordpress.com/
Another option is to use Content Editor webpart and add bootstrap html forms.
I hope it may help u.
Coding in Classic View is the only solution to your query. Once you are done coding in classic, you can switch/migrate to Modern View Experience.
In this way, your form will be visible and lists will also be consumed.
Nope!.. Modern sites are totally different development model So JSLink is not possible but you can use SharePoint framework extension to achieve the customization for the list.
Please follow the link below
JSLink to SPFX extensions
Please mark if accepted as answer

SharePoint 2013 Dynamic Data on all pages

If I have a requirement of displaying the a content on all the pages inside a header, Whats the best way to do that in an SharePoint 2013?
I am working on a master page that will be using the design manager and there is possibility of using the same master page in the SharePoint online too. The reason why I want to know what is the best way, when I use this same master page in SharePoint online I would like avoid redoing that entire coding for getting a dynamic data from the web service.
Several ways that I have been planning is below
- User control method
- Web part method, but requires server side coding which I doubt can used in online version
This is a complete dynamic data that will be retrieved by a web service and no internal SharePoint data be used.
Thanks for reading
Deepak
If its possible to consume web-service using jQuery/Ajax call you can go with that
Or else if you want to use c#, might need to go with provider hosted app feature (sharepoint 2013)
You can create a Visual Web Part for SharePoint 2013 Online.
Your web part will be contained in a Sandbox Solution which you will develop locally. Once development is complete you will upload the Solution Package created by Visual Studio to SharePoint Online.
https://sharepoint.stackexchange.com/questions/80164/create-visual-webpart-for-sharepoint-online
http://sharepoint-community.net/profiles/blogs/sharepoint-online-2013-web-part-deployment

SharePoint 2007 web parts integration with Project Server 2007

To my knowledge, web parts have the ability to display portions of other Web pages.
Is it possible to integrate SharePoint 07 with Project Server 07 and display portions of a Web page from the Project Server via a web part that's on a SharePoint site. If it's possible, how difficult is it to do?
I found these pages (Integration with Office SharePoint Server 2007, and SharePoint Integration) explaining a bit about the integration but I'm no SharePoint expert, I'm actually new to SharePoint, so much of what is mentioned there doesn't help me much.
You may already be aware that Project Server actually is SharePoint, with additional components. A Project Web Access (PWA) portal is a SharePoint site collection that is aware of both the SharePoint content database and the four Project Server databases, and contains a boatload of web parts and pages that present Project data and manage processes within the SharePoint site collection
The simplest out-of-the-box web part for showing pages within a SharePoint page is the Page Viewer Web Part. Under the hood, it drops an IFrame on the page to give the effect of looking at a page within a page.
I'm not familiar with Project Server but I am familiar with SharePoint. Web Parts in SharePoint can contain any arbitrary code and are more or less identical to regular ASP.NET web parts - in fact SharePoint web parts inherit from ASP.NET web parts.
From the second article you mentioned, it looks like Project Server contains its own set of SharePoint web parts, so you are likely to get better integration with SharePoint using these than simply by displaying a web page inside another one (sounds to me more like an IFRAME).
As a quick SharePoint overview, there are 3 versions of SPT 2007 - Windows SharePoint Services 3.0, which ships alongside Windows Server 2003; Microsoft Office SharePoint Server (MOSS) 2007 Standard, which adds portal, content management and enterprise search features; and MOSS 2007 Enterprise, which adds other tools for line-of-business app integration, including the Business Data Catalog (BDC). The BDC is meant to be an easy way of getting line-of-business data into SharePoint. It uses an XML definition file but don't try cutting one by hand!
However, SharePoint 2010 has now been released (I'm not an expert). SharePoint 2010 Foundation is roughly equivalent to WSS 3.0. SharePoint 2010 is 64 bit only. It looks like quite a nice step up from WSS 3 / MOSS 2007. Don't forget though that SPT 2007 is already 3 years old, so it's already well advanced down its support lifecycle.

MOSS 2007: Displaying data from SQL Server Database

I have a requirement to select some data from a table in a database (SQL Server) and display it on a page in a SharePoint site (MOSS 2007).
I have a little bit of experience of MOSS, so I know I have a couple of options:
BDC
SSRS
or possibily even a custom ASPX page.
I've never really worked with any of these. Can anyone advise on the +/-'s of each?
It all depends on what functionality is required once the table is displayed in SharePoint. Do you need extra bells and whistles or is a dump of the data adequate? (Think about the future as well.) Here's some thoughts...
Business Data Catalog (BDC)
If you want to nicely integrate the SharePoint look and feel with your data as well as get some cool functionality, BDC is a good solution. There is no need to program anything and these are the features you get. However if this data will only be used once in one way then it is probably overkill.
You would need to roll your own XML description of the data so SharePoint knows how to pull it from the database (or use something third party like Lightning Tools). As Colin mentioned it requires the Enterprise license of MOSS.
SQL Server Reporting Services (SSRS)
If Reporting Services is already available for use then this is the quickest and simplest solution. It works well but can get painful as more advanced features are required in your reports.
You should be able to use the Report Designer wizard to point to your table and set everything up for you. There are SSRS web parts that can be used within SharePoint, or indeed you can run SSRS inside SharePoint using SharePoint integration mode.
Application Page
This method Steven mentioned lets you integrate an ASP.NET application into SharePoint (such that it can be accessible by a URL within your SharePoint site). This allows anything that ASP.NET does, and the code-behind will be aware of SharePoint so you can tap into that if needed as well. The cons here are code access security and deployment.
See this webcast for how to do it.
Web Part
Similar to developing an application page but much more integrated with SharePoint. A custom web part is very powerful and allows you to integrate ASP.NET code on a SharePoint page. As you would know web parts can be dragged to whatever location and give a consistent properties pane. Again, code access security and deployment needs to be considered.
If you like designer view in Visual Studio then be aware this isn't the approach that Microsoft push. You can however use something like SmartPart where you would develop your custom app as a user control and the SmartPart wraps it into a web part. I'm used to doing it the MS way now and actually prefer the additional control this gives, however it can take more time.
Page Viewer Web Part
If you don't want to touch your SharePoint installation at all then have a look at this web part. It takes a URL as parameter and displays an IFrame containing the page that would be your report, either in SSRS or standard ASP.NET.
The downside from this lack of integration is problems with sizing the IFrame, and possible security warnings from the browser if accessing the URL in a different domain.
Don't forget the DataView Webpart. It has a pretty small developement footprint and works really well as a first "cut" if you are unsure as to how hardcore you need the final result to be.
It renders using XSLT, giving you full control of the final HTML, so it can do some pretty things with Javascript and co.
For a very simple example of charting.
Have you ever used the .NET Framework do develop webpages?
MOSS 2007 uses this framework for master / template files.
So your best choice would be to create an ASPX template file to display the results on the webpage.
BDC is the way to go if you want to keep it "strictly Sharepoint". The problem is, it is only included in the Enterprise edition of SharePoint. If you have the Standard edition, you could go for SSRS and the SSRS webpart, or, create your own webpart. That way you can use your data display anywhere in your site and it's also ASP.NET compatible.
As Nat said - if all that is needed is to display some data from a database on a page - the DVWP is a great solution. Just open your page in SharePoint Designer, add the database connection, and drop the web part on your page. You can use any of the several pre-formatted layouts, or design/tweak your own so the data is displayed as you need.
Relatively straightforward, lots of HowTos online, and far faster/easier to setup than something like BDC.

Resources