DisableRequestValidation prevents displaying the page
I am using umbraco 4.7.0 with .net 4. I have a slideshow where my news are displayed on homepage. News source is a rss feed created by xslt. I can display and see slideshow without any problem but when you click one of the news in the slideshow, it should direct you news detail page but upon clicking I got following error.
A potentially dangerous Request.QueryString value was
detected from the client (~/<link xmlns:media="...helper"> <a
href="/news/k...").
I searched for that issue on the net and tried in web.config like in the following
<httpRuntime requestValidationMode="2.0" />
<pages validateRequest="false" />
but those suggestion did not work out so after searching in umbraco, I found that I should add below code in the master template
<!-- Update these variables to modify the feed --> <xsl:variable name="RSSNoItems" select="string('200')"/> <xsl:variable name="RSSTitle" select="string('My sample rss')"/> <xsl:variable name="SiteURL" select="concat('http://', string(umbraco.library:RequestServerVariables('HTTP_HOST')))"/> <xsl:variable name="RSSDescription" select="string('Add your description here')"/>
<!-- This gets all news and events and orders by updateDate to use for the pubDate in RSS feed --> <xsl:variable name="pubDate"> <xsl:for-each select="$currentPage/* [@isDoc]"> <xsl:sort select="@createDate" data-type="text" order="descending" /> <xsl:if test="position() = 1"> <xsl:value-of select="updateDate" /> </xsl:if> </xsl:for-each> </xsl:variable>
<xsl:template match="/"> <!-- change the mimetype for the current page to xml --> <xsl:value-of select="umbraco.library:ChangeContentType('text/xml')"/>
DisableRequestValidation prevents displaying the page
I am using umbraco 4.7.0 with .net 4. I have a slideshow where my news are displayed on homepage. News source is a rss feed created by xslt. I can display and see slideshow without any problem but when you click one of the news in the slideshow, it should direct you news detail page but upon clicking I got following error.
I searched for that issue on the net and tried in web.config like in the following
but those suggestion did not work out so after searching in umbraco, I found that I should add below code in the master template
but this time when you click one of news in slideshow, it redirects you "page not found" error page set in umbracoSettings.config.
I also add code snippet which causes that error in xslt file
Any idea?
Hello friend!. I tell you that I read your problem, which also happened to me. What I did was I put in your code:
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
<umbraco:DisableRequestValidation runat="server"/>
<!--MY CODE HTML-->
</asp:Content>
and it works great!.Thank you!
is working on a reply...