I am using SDL Tridion 2011. I have created a Component of field type 'text', and linked an already published component to a text in it.
After this i have inserted the component to a page and published that (i used Link Resolver TBB). when i viewed that page in browser,link was not appearing and when i checked code , following was wriiten in place of link
<tridion:ComponentLink runat="server" PageURI="tcm:150-12575-64"
ComponentURI="tcm:150-12344" TemplateURI="tcm:0-0-0" AddAnchor="false"
LinkText="component" LinkAttributes=" title="Video link"
target="_blank" " TextOnFail="true"/>
Template type is Compound Template and Code :-
<CompoundTemplate xmlns="http://www.tridion.com/ContentManager/5.3/CompoundTemplate">
<TemplateInvocation>
<Template xlink:href="tcm:150-12576-2048" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="Test" />
<TemplateParameters>
<Parameters xmlns="uuid:b81e2790-ded1-4fb2-b09a-4a2975c2938e" />
</TemplateParameters>
</TemplateInvocation>
<TemplateInvocation>
<Template xlink:href="tcm:150-12176-2048" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="Default Finish Actions" />
<TemplateParameters>
<Parameters xmlns="uuid:a13c5753-adfc-4e93-912f-ee3d93b6a828" />
</TemplateParameters>
</TemplateInvocation>
</CompoundTemplate>
The Link Resolver TBB will resolve a Component link to either a ASP.NET or JSP tag depending on the configuration of your Deployer and/or Publication Target. Looking at your tag it is resolved to a ASP.NET tag (judging from the runat="server" attribute).
Now to make it work you must ensure you configure the API server role for your ASP.NET web application and of course your pages need to have the right file extension (.aspx usually) to ensure the tags in them are executed.
Simply put what you need to do is register the tag prefix for the SDL Tridion Dynamic Link tag. You do this in your wep applications web.config file, as follows:
<configuration>
<system.web>
<pages>
<controls>
<add tagPrefix="tridion"
namespace="Tridion.ContentDelivery.Web.UI"
assembly="Tridion.ContentDelivery" />
</controls>
</pages>
</system.web>
</configuration>
More about this topic can be found in our online documentation: Configuring the API server role for a .NET Web application (logon required, see here for details)
Related
I´m using Plesk and in Web scripting and statistics I have Microsoft ASP support in ON.
I uploaded a application (which works correctly in my PC) to a directory and it can be shown but when I go to the aspx file it shows me the 404 error (The path is the correct).
I noticed that some files in "shtml" extension are neither shown by the server.
This is my very first time with ASP.NET, ISS8 and Plesk. I don´t know what to do. I will thank you for your help
You have to set the HTTP Handler Extension. If you have no access to IIS directly, you could do on the web.config:
Open the Web.config file for the application, locate the httpHandlers element of the system.web section and add an entry for the file-name extension
Example:
<system.webServer>
<handlers>
<add name="SampleHandler" verb="*"
path="SampleHandler.new"
type="SampleHandler, SampleHandlerAssembly"
resourceType="Unspecified" />
</handlers>
</system.webServer>
For more configuration options please refer to:
https://msdn.microsoft.com/en-us/library/bb515343.aspx
and
https://msdn.microsoft.com/en-us/library/46c5ddfy(v=vs.100).aspx
Check also the Custom Handler Policy of Plesk that should not be enabled:
https://docs.plesk.com/en-US/onyx/administrator-guide/plesk-administration/securing-plesk/custom-handlers-policy.76787/
Here I've found also another interesting document:
https://learn.microsoft.com/en-us/iis/configuration/system.webserver/handlers/
Scroll down and you'll find a piece of code to add the handlers programmatically, even if I suggest you to add them in your web.config
I am referencing a class library in a web application project (both in same solution). Within the web pages of the web application, if I do this:
If MyValidation.CorrectEmailFormat(email) Then ...
...Visual Studio 2013 underlines the method, and suggests I import MyCompany.EmailMethods at the top of the page. If I do the Import, the page compiles and the method works okay.
However, because these methods are used extensively across the application, I don't want to add them at page level every time. So I headed for web.config, and did this:
<pages>
<namespaces>
<add namespace="MyCompany.EmailMethods" />
</namespaces>
</pages>
However, VS is still prompting me to perform the Import at the top of every page, and the method is not recognised in the page without doing this. What I am doing wrong please? I assumed from MSDN and other sources this was the correct way to achieve this.
Web application is ASP.Net web pages (4.6).
The reference must be added to the Imported Namespace as described in the following SO post
add-a-namespace-reference-to-all-web-application-web-pages-in-a-different-project
It must be added in the project properties page at the bottom part titled Imported Namespaces
The <pages> directive applies to ASPX files only.
You need to use the equivalent directive for Razor:
<system.web.webPages.razor>
<pages>
<namespaces>
<add namespace="MyCompany.EmailMethods" />
This is a continuation of a answered question in the following link:
How to set Allow Parent Paths in IIS Express Config
I am running a classic asp web site in IISexpress.
The same web site is also used in IIS 7.5 in a w7 pro and works fine enabling the parent paths in the IIS configuration of the web but trying to use the web.config in IISExpress does not work
The problem that I am experiencing is that in the suggested web.config in order to enable the parent paths:
<configuration>
<system.webServer>
<asp
enableParentPaths="true"
bufferingOn="true"
errorsToNTLog="true"
appAllowDebugging="true"
appAllowClientDebug="true"
scriptErrorSentToBrowser="true">
<session allowSessionState="true" />
<cache diskTemplateCacheDirectory="%TEMP%\iisexpress\ASP Compiled Templates" />
<limits />
</asp>
</system.webServer>
</configuration>
I get a 500 error every time that I try to use any asp tag
If I remove the asp tag it all works fine,
Anybody has a clue?
TIA
You have not read carefully. The configuration file that mentioned isn't web.config. It is applicationHost.config. As a shotcut:
Press Win+R
type
notepad "%userprofile%\Documents\IISExpress\config\applicationhost.config"
hit ⏎. This will open the host configuration file with notepad. You need to find your web site's section. It's something like <location path="YourSiteName"> ... </location>. Look inside that node, find the <asp> section and change with yours. Finally, don't forget to remove the asp section from web.config.
In our system most of the code is in an asp.net (2.0) web site, I discovered Castle Monorail a few month ago and I think it's really easier to use than asp.net / webforms.
Here is what we need :
- Use Castle Monorail
- Our code must be in the website (my chief is a kind of old school web developer so he prefer to have some ".cs" files than one ".dll").
- We have to keep the existing webforms code
So maybe if you have a tutorial or something like that (I found a lot of tutorial about asp.net MVC and castle monorail but I did find any with asp.net 2.0)/
Merci les collegues
So it was pretty simple (15 min top) :
1/ Get the element that you need from web.config :
- config section handler
<section name="monorail" type="Castle.MonoRail.Framework.Configuration.MonoRailSectionHandler, Castle.MonoRail.Framework" />
-Configuration itself
<monorail>
<controllers>
<assembly>App_Code</assembly>
<assembly>Castle.Monorail.ViewComponents</assembly>
</controllers>
<viewEngines viewPathRoot="Views">
<add type="Castle.MonoRail.Framework.Views.NVelocity.NVelocityViewEngine, Castle.MonoRail.Framework.Views.NVelocity" />
</viewEngines>
</monorail>
"App_Code" is the name of the web site assembly.
-http handlers
<add verb="*" path="*.rails" type="Castle.MonoRail.Framework.MonoRailHttpHandlerFactory, Castle.MonoRail.Framework" />
<!--block direct user access to template files-->
<add verb="*" path="*.vm" type="System.Web.HttpForbiddenHandler" />
<add verb="*" path="*.boo" type="System.Web.HttpForbiddenHandler" />
<add verb="*" path="*.st" type="System.Web.HttpForbiddenHandler" />
-http modules
<add name="monorail" type="Castle.MonoRail.Framework.EngineContextModule, Castle.MonoRail.Framework" />
2/ Take the dll that you need, in my case (I don't use activerecord) :
Castle.Components.Binder.dll
Castle.Components.Common.EmailSender.dll
Castle.Components.Common.TemplateEngine.dll
Castle.Components.Common.TemplateEngine.NVelocityTemplateEngine.dll
Castle.Components.Validator.dll
Castle.Core.dll
Castle.MonoRail.Framework.dll
Castle.MonoRail.Framework.Views.NVelocity.dll
Castle.MonoRail.ViewComponents.dll
3/ Add a class in your App_Code folder (for instance TestMonorailController) :
using Castle.MonoRail.Framework;
public class TestMonorailController : SmartDispatcherController
{
public TestMonorailController()
{
}
public void OnePage()
{
PropertyBag["toto"] = "TEST";
}
}
4/ Add a Views folder in the root of your website
5/ Add a TestMonorail folder in the folder you just created
6/ Add a file name "OnePage.vm" in this folder :
$toto
7/ Test your website :
http://localhost:XX/YourWebSite/TestMonorail/OnePage.rails
and you should see
"TEST"
Et voila :) I can edit my production code. Thx Ken
I guess that you could put the controller classes in App_Code and be done with it.
you will need to map a special extension for Monorail urls.
If you do not use SOAP webservices (.asmx) then map this extension to Monorail's HttpHandlerFactory.
An interesting culprit could be that the actual assembly containing the App_code files does not have a nice name (I think), and MonoRail does need to know the assembly from which to locate controller classes.
I'd suggest you play with the hints I've listed above and see where it gets you. Share the exceptions you see and hopefully we'll get to the bottom of it soon
I'm using the ASP.NET Login Controls and Forms Authentication for membership/credentials for an ASP.NET web application. And I'm using a site map for site navigation.
I have ASP.NET TreeView and Menu navigation controls populated using a SiteMapDataSource. But off-limits administrator-only pages are visible to non-administrator users.
Kevin Pang wrote:
I'm not sure how this question is any
different than your other question…
The other question deals with assigning and maintaining permissions.
This question just deals with presentation of navigation. Specifically TreeView and Menu controls with sitemap data sources.
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" />
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False" />
Nicholas wrote:
add role="SomeRole" in the sitemap
Does that only handle the display issue? Or are such page permissions enforced?
I had to set securityTrimmingEnabled to "true" in my web.config file.
<?xml version="1.0"?>
<configuration>
...
<system.web>
...
<siteMap defaultProvider="default">
<providers>
<clear/>
<add name="default"
type="System.Web.XmlSiteMapProvider"
siteMapFile="web.sitemap"
securityTrimmingEnabled="true"/>
</providers>
</siteMap>
...
</system.web>
...
</configuration>
I'm not sure how this question is any different than your other question, but I'll try to answer it anyways.
If you want a tutorial on how to implement role-based authentication, check out the one from 4GuysFromRolla.
securityTrimmingEnabled="true" works for internal pages that have a config file restricting permissions, you can also add role="SomeRole" in the sitemap to ovveride the display mechanism, which is useful if you have menu items to external sites.