Using AspCompat in a SharePoint web part page - asp.net

I'm in the process of creating a SharePoint web part that needs to use a single-threaded COM component. I've discovered that in order to make this work well, I need to add the AspCompat="true" directive to the page where the web part will live. The problem is I can't seem to set up such a page.
I created a new blank web part page via the regular browser interface, then added AspCompat to it using SharePoint Designer. But that causes it to become un-ghosted and the SafeMode parser says that directive isn't allowed. I then modified the blank web part page template to include the directive and created a new page, but got the same error.
I basically need to set up a page within my SharePoint site that is stored in the file system, has that directive, and can contain my web part. How would I go about creating such a page?

I recently answered this question with some instructions that includes how to supply new site content page templates that you can use to host web parts. I think it's likely to work for you.
In your case, your aspx page template would have that AspCompat directive built-in.

According to Microsoft SharePoint developer support, it is simply not possible to use AspCompat within a SharePoint site. The SPPageParserFilter class, which is the one that disallows certain page directives, is apparently involved in processing all pages, even those that are on the file system. See this blog post for more details.

Related

Looking for Server Side Rendering using VUEJS having ASPX page and site hosting on IIS7

We have our existing pages in ASPX and site is hosted on IIS7 server.
We are looking for revamping/design the pages in VUEJS 2.0.
We are able to get VueJS code integrated with existing ASPX pages by getting build.js generated (production) and referring the same on ASPX page and page will be having the Target element. This all is client side rendering.
Now, we want the same in SSR. That mean to be complete HTML code rendered on the page before being served to the client (browser).
This clearly indicates we need to setup NodeServer, which can be called up by ASP.NET to get the VUEJS code rendered and added on ASPX page before it's being served to the Client (Browser). Please correct me If I am wrong. Here we are looking for a dynamic webages (Not the static one with prerendering or static generation)
We have started looking up for NUXT.JS as one of the options. But this is recommended to be used for the apps hosted for NodeServer.
ref:https://github.com/MarkPieszak/aspnetcore-Vue-starter/issues/67
1: https://github.com/MarkPieszak/aspnetcore-Vue-starter/issues/67
Other big challenge going with Nuxt is, they are likely launching Nuxt2.js version, which may or may not have breaking changes. https://medium.com/nuxt/nuxt-2-is-coming-oh-yeah-212c1a9e1a67
Next option is to looking for following:
https://github.com/MarkPieszak/aspnetcore-Vue-starter
https://github.com/vuejs/vue-hackernews-2.0
http://mgyongyosi.com/2016/Vuejs-server-side-rendering-with-aspnet-core/
Above links mentions using ASP.net core API Microsoft.AspNetCore.SpaServices.Webpack.
I believe you must have faced this situation and reached to an optimal solution. I am looking for suggestions from veterans have achieved the same, what path to be followed?
IF this can be achieved at all? and what are the challenges I should look forward?
Thanks

I can't find options for Select Master Page or Place code in separate file in VS2012

I installed VS 2012 on my work PC, and for the life of me when I go to add a new web form, I cannot see or find the 2 options for Select Master Page or Place code in separate file.
Any ideas on how i can find them?
I've just been fooled by just that for the past hour. What I've found is that the 'old' method of using the menu option 'Add web page using master' (or similar) has vanished, and been replaced by 'Content Page'. When you select this, you're then given the option of choosing a master page.
Incidentally, I don't get the option of starting a web site project, which may be why I'm not seeing this either.
You should have web form with master page in the add items?
Placing code in separate file is a different concept called code-behind. You will have an ASPX file and a cs / vb file which handles the events.
e.g.
Default.aspx
Default.aspx.cs
EDIT: Based on comment.
You may be using a Web Site on your laptop, but a Web Application in work. See Web Application Projects v's Web Site Projects.
Take a look at ASP.NET Web Site or ASP.NET Web Application?, this might also help in deciding which to use. Generally, I always go for Web Application.
You can use VS to convert from a Web Site to a Web Application, but AFAIK, you can't do it the other way round unless you create a new project and copy across the relevant parts - which could be a big job depending on the size of the site.

Using SPWebPartManager and Sharepoint WebParts in standard ASP.NET page

I have a server with WSS 3.0 installed and a functional team site. But I want to build a series of pages on a seperate site that are standard asp.net 2.0 type pages but include web parts and will display some summary information and links back to the WSS site (like to the documents). The pages will be added to an existing site that will not be converted to a WSS site.
I have attempted to include the SPWebPartManager (and WebPartZones) to the page but am getting a "Object reference not set to an instance of an object." even though I have done the "Register Tagprefix="SharePoint" on the page and included the Microsoft.Shareoint reference in the project.
Does anyone know where I can get a minimal environment for a page to do this type of thing?
Thanks
you know asp.net has it's own web part manager. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpartmanager.aspx
although what it sounds like to me you are trying to do is simply read documents from a sharepoint list. In which case you dont need sharepoint web parts you just need to call the sharepoint web services.

ASP.NET - IIS Custom Mapping Extensions - How?

I am wondering how one goes about creating/rerouting my custom developed .ASPX pages on IIS 6.0 pages to something totally custom w/o the .aspx extension, say, .vato? For example, instead of my page saying: Default.aspx?ID=123, I would like users to see: Default.vato?ID=123.
What concept is? Is this doable? Where can I research more on this topic?
Yeah, read this:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/4c840252-fab7-427e-a197-7facb6649106.mspx?mfr=true
Create a new entry for your new extension and map it to the same executable as the .aspx handler.
The common one is to add a wildcard. This allows you to have URLs without extensions at all. IMO, that's much preferred because extensions make little sense on the internet.
It's not so much a .net question as it is an IIS question.
Basically, IIS looks at what extension is being requested and responds accordingly.
There is a list of all file extensions and what actions should be taken when these are requested. In terms of .net, these are .aspx, .ascx, asmx, etc. These are basically ISAPI filters.
Depending on your version of IIS. If you open IIS Manager, choose the website in question, go to Properties, then Home Directory, then Configuration, under Mappings you will see all file extensions and the application that will be called to action this request.
Therefore, if you add an entry for .vato, and point it to your version of .net, such as C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll then the .vato file will then be treated the same as a .aspx files.
In IIS (6.0) click on "Configuration" on your Web Site page and you can add mappings there. It must reference the same ASP.NET ISAPI DLL as for example the ASPX pages.
You can also add * and have all requests route to a HTTP module but that's a little more advanced and useful for the likes of REST.

How to generate ASP.NET page every time when using master pages?

I'm moving an old VBScript web site over to ASP.NET, so I'm starting to use master pages instead of #includeing lots of other files with server side VBScript in them.
How can I stop the pages (as in the ones that are based on master pages) from being generated once and then stored? If I make a change to the master page (or any page based on them) those changes are not visible, because the web server is still giving out the previous versions.
It sounds like you have caching enabled, as normal behaviour without caching is to regenrate.
That shouldn't be the case, are you sure it's not a caching issue?

Resources