ASP code not processing after application migration to 4.0 CLR - iis

I have the below code inside a Footer which is a asp page. This asp footer page when rendered inside an aspx page does not process the below lines of code. This used to work in IIS 2.0 Application pool, but when I migrated the application to 4.0 App Pool this code is not getting processed. What could be the issue with my new App Pool or is there anything I am missing?
<%response.write("Copyright "&Year(Date))%>
<% if Request.ServerVariables("SERVER_PORT_SECURE") = 1 then %>
<% end if%>

Related

Why does the onclick event not work, in my razor pages hosted blazor component, in .net 7.0?

This code has been working just right in a blazor web assembly, embedded in a razor pages page, using .net 5.0 and .net 6.0.
I had to upgrade to .net 7.0, by altering the framework in razor pages and blazor projects' properties, to fix a big something else and now it doesn't work.
The onclick event is just not being detected.
<p>#(Myawesomevariable)</p>
<button #onclick="Myawesomefunction">Myawesomebutton</button>
#code
{
private int Myawesomevariable = 0;
private void Myawesomefunction()
{
Myawesomevariable++;
}
}
What th' flip?
Okay, you lucky people, here's the fix.
In .net 7.0, first create blazor webassembly solution from the visual studio template, with a client, a server and a shared project.
From the client project, wwwroot folder, delete the index.html file.
From the client project, delete these two lines in the program.cs file:
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
Create a new blazor server project using the visual studio template and copy the _Host.cshtml file from the blazor server project's pages folder, to your project's pages folder and remove the following lines:
<link href="css/site.css" rel="stylesheet" />
<link href="<THE PROJECT NAMESPACE>.styles.css" rel="stylesheet" />
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
and
<script src="_framework/blazor.server.js"></script>
Replacing them with:
<link href="css/app.css" rel="stylesheet" />
<link href="<YOUR PROJECT NAMESPACE>.Client.styles.css" rel="stylesheet" />
<component type="typeof(HeadOutlet)" render-mode="WebAssemblyPrerendered" />
and
<script src="_framework/blazor.webassembly.js"></script>
Create a new razor pages project and copy the following files from the razor pages pages folder to your projects pages folder:
Pages/Shared/_Layout.cshtml
Pages/Shared/_Layout.cshtml.css
Pages/_ViewImports.cshtml
Pages/_ViewStart.cshtml
In the imported _Host.cshtml file, edit the namespace to
#namespace <YOUR PROJECT NAMESPACE>.Server.Pages
and add a reference to the client project
#using <YOUR PROJECT NAMESPACE>.Client
Finally, remove any references to blazor.server.js and make sure every blazor pages calls the blazor.webassembly.js file.
<script src="_framework/blazor.server.js"></script>
I now have a .net 7.0 razor pages project, with blazor components embedded in different pages AND the onclick event handler works.

Websphere Portal - How to retrieve portal title/friendly URL?

How do we get the friendly url or portal title using java?
For example if I go to websphere to put the title and friendly url, how do I exactly retrieve it (using jsp)
The WebSphere Portal Server has concept of NavigationSelectionModel SPI that you can use to know about the current page.This SPI is used by the theme to know the page which should be displayed to the user.Can be used in portlet application. To get the page title / unique name where your portlet is getting rendered, here is the code:
Step 1. Include portal taglib on JSP
<%# taglib uri="/WEB-INF/tld/portal.tld" prefix="wps" %>
Step 2. Use <wps:navigation> tag.
<wps:navigation>
<wps:navigationloop>
<%if (wpsSelectionModel.isNodeSelected(wpsNavNode)){
String pageTitle = com.ibm.wps.model.LocaleHelper.getTitle
((com.ibm.portal.Localized)wpsNavNode, request);
String uniqueName = wpsNavNode.getContentNode().getObjectID().getUniqueName();
System.out.println("pageTitle : " + pageTitle);
System.out.println("uniqueName : " + uniqueName);
}%>
</wps:navigationloop>
</wps:navigation>

How to add custom user control in SharePoint 2013 HTML master page

I am trying to add custom usercontrol in SharePoint 2013 HTML master page, but its not working and showing the message
SharePoint can't parse this file, most likely because of an incorrectly formatted SharePoint snippet. The markup at the following location is causing problems. Edit the markup manually to fix it, or replace it with a new snippet from the Snippet Gallery.
Invalid SharePoint markup at line 145. Please repair or recreate the markup
following is the code snippet for HTML master page.
<!--CS: Start Create Snippets From Custom ASP.NET Markup Snippet-->
<!--SPM:<%# Register Src="~/_controltemplates/15/SharePointProject1/UserControl1.ascx" TagPrefix="uc1" TagName="MyDepartmentControl" %>-->
<!--SPM:<uc1:MyDepartmentControl runat="server" id="MyDepartmentControl1" />-->
<!--CE: End Create Snippets From Custom ASP.NET Markup Snippet-->
Please help me how i can make it possible to add asp.net user-control in SharePoint 2013 HTML Master page.
Thanks in advance.
I just solved this problem.
The answer is; convert this line
<!--SPM:<%# Register Src="~/_controltemplates/15/SharePointProject1/UserControl1.ascx" TagPrefix="uc1" TagName="MyDepartmentControl" %>-->
to
<!--SPM:<%# Register TagPrefix="uc1" TagName="MyDepartmentControl" Src="~/_controltemplates/15/SharePointProject1/UserControl1.ascx" %>-->
Have fun..

OpenShift: Too many active sessions

I got an error in OpenShift scalable (JSF JBossAS 7.1) application:
2014/06/19 03:39:55,581 FATAL
[org.apache.jasper.runtime.JspFactoryImpl]
(http-127.12.210.1-127.12.210.1-8080-2) Exception initializing page
context: java.lang.IllegalStateException: createSession: Too many
active sessions
I configured STATE_SAVING_METHOD to client but error is the same.
Why does this error appears?
it seems the solution is put next code snippet to jsp page which is available for haproxy
<%# page session="false" %>

Apply Web Part Connections to web parts on the ascx page of other web parts

I have created a visual web part that combines two other previously created web parts into one nicely styled web part. This is done simply by adding Register tags to the ascx page of the web part, and then adding the web part tags just as I would on a page layout, like so:
WebPart_ParentAssignmentsUserControl.ascx:
<%# Register tagprefix="WebParts" namespace="Microsoft.SharePointLearningKit.WebParts" assembly="Microsoft.SharePointLearningKit, Version=1.3.1.0, Culture=neutral, PublicKeyToken=24e5ae139825747e" %>
<%# Register tagprefix="MyChildrenWebPart" namespace="MLG2010.WebParts.MyChildren.MyChildrenWebPart" assembly="MLG2010.WebParts.MyChildren, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" %>
<WebParts:AssignmentListWebPart runat="server" ListScope="false" AllowEdit="True" AllowConnect="True" Title="Assignment List Web Part" IsIncluded="True" Dir="Default" SummaryWidth="150px" IsVisible="True" AllowMinimize="True" AllowHide="True" ExportControlledProperties="True" ZoneID="" ID="g_1c528b46_baf2_4cf2_a004_91f84c4f4556" FrameState="Normal" DisplaySummary="True" ExportMode="All" SuppressWebPartChrome="False" DetailLink="" HelpLink="" MissingAssembly="Cannot import this Web Part." PartImageSmall="" AllowRemove="True" ToolTip="Assignment List - Use this web part to keep track of your SharePoint Learning Kit assignments." HelpMode="Modeless" FrameType="Default" AllowZoneChange="True" PartOrder="0" Description="Display the assignments for an instructor or learner." PartImageLarge="" IsIncludedFilter="" __MarkupType="vsattributemarkup" __WebPartId="{1c528b46-baf2-4cf2-a004-91f84c4f4556}" WebPart="true" Height="" Width=""></WebParts:AssignmentListWebPart>
<MyChildrenWebPart:MyChildrenWebPart runat="server" PageSize="5" StudentsSiteURL="/student" PictureLibraryTitle="Students Picture Library" ADChildAttribute="otheripphone" Description="My WebPart" DefaultPictureURL="../../Students Picture Library/DefaultChild.jpg" ShowErrors="True" PictureLibraryUrl="../../Students Picture Library" Title="MyChildrenWebPart" ADEntryPoint="LDAP://dc=redconnect-test" __MarkupType="vsattributemarkup" __WebPartId="{d13a3729-e2b8-4436-ac1b-b75c914a3596}" WebPart="true" __designer:IsClosed="false" id="g_d13a3729_e2b8_4436_ac1b_b75c914a3596"></MyChildrenWebPart:MyChildrenWebPart>
The problem here, is that I need these two web parts to communicate via web part connections. since they are only added here on the aspx, sharepoint does not "know" about them, and thus they do not get a chrome and thus I cannot set up the web part connections in the browser.
Is there a way to set up web part connections on web parts that are added this way? Or maybe if I can just activate the chrome on these web parts?
You can define the connection statically. Note that using this way, you cannot create/modify/delete the connection using the browser.
See:
How to: Declare a Static Connection between Two Web Parts Controls
In the end, I separated the web part into the pieces that could connect normally, and then used styling to make it look as if they were one. I have not found any documentation on the consequences of putting web parts inside other web parts as i attempted.

Resources