{"id":20,"date":"2008-03-07T15:04:00","date_gmt":"2008-03-07T14:04:00","guid":{"rendered":"https:\/\/iddlesblog.wordpress.com\/2008\/03\/07\/asp-net-and-sharepoint\/"},"modified":"2008-03-07T15:04:00","modified_gmt":"2008-03-07T14:04:00","slug":"asp-net-and-sharepoint","status":"publish","type":"post","link":"https:\/\/iddles.co.uk\/index.php\/2008\/03\/07\/asp-net-and-sharepoint\/","title":{"rendered":"ASP.Net and SharePoint"},"content":{"rendered":"<p>Its taken me long enough but finally had a reason to write some true ASP.Net code.\u00a0 One problem I hit was that trying to run code on a server that is running SharePoint Services &#8230;. so you need this exceprt&#8230;.<br \/>\n\u00a0<strong>You may see this error:<\/strong><\/p>\n<div class=\"code\">An error occurred during the processing of \/test.aspx. Code blocks are not allowed in this file.<\/div>\n<p><strong>Reason:\u00a0 <\/strong>SharePoint does not allow server side code to execute in aspx pages contained in the SharePoint site.<br \/>\n<strong>Fix:<\/strong>\u00a0 Edit the web.config (I.E.<strong> C:InetpubwwwrootwssVirtualDirectories80web.config<\/strong>) file:<\/p>\n<div class=\"code\"><span class=\"kwrd\">&lt;<\/span><span class=\"html\">PageParserPaths<\/span><span class=\"kwrd\">&gt;<\/span><br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 <span class=\"rem\">&lt;!&#8211; To allow a single file: &#8211;&gt;<\/span><br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 <span class=\"kwrd\">&lt;<\/span><span class=\"html\">PageParserPath<\/span> <span class=\"attr\">VirtualPath<\/span><span class=\"kwrd\">=&#8221;\/test.aspx&#8221;<\/span> <span class=\"attr\">CompilationMode<\/span><span class=\"kwrd\">=&#8221;Always&#8221;<\/span> <span class=\"attr\">AllowServerSideScript<\/span><span class=\"kwrd\">=&#8221;true&#8221;<\/span> <span class=\"kwrd\">\/&gt;<\/span><br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 <span class=\"rem\">&lt;!&#8211; To allow global: &#8211;&gt;<\/span><br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 <span class=\"kwrd\">&lt;<\/span><span class=\"html\">PageParserPath<\/span> <span class=\"attr\">VirtualPath<\/span><span class=\"kwrd\">=&#8221;\/*&#8221;<\/span> <span class=\"attr\">CompilationMode<\/span><span class=\"kwrd\">=&#8221;Always&#8221;<\/span> <span class=\"attr\">AllowServerSideScript<\/span><span class=\"kwrd\">=&#8221;true&#8221;<\/span> <span class=\"kwrd\">\/&gt;<\/span><br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 <span class=\"rem\">&lt;!&#8211; To allow global within a subsite: &#8211;&gt;<\/span><br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 <span class=\"kwrd\">&lt;<\/span><span class=\"html\">PageParserPath<\/span> <span class=\"attr\">VirtualPath<\/span><span class=\"kwrd\">=&#8221;\/websitefoobar\/*&#8221;<\/span> <span class=\"attr\">CompilationMode<\/span><span class=\"kwrd\">=&#8221;Always&#8221;<\/span> <span class=\"attr\">AllowServerSideScript<\/span><span class=\"kwrd\">=&#8221;true&#8221;<\/span> <span class=\"kwrd\">\/&gt;<\/span><br \/>\n<span class=\"kwrd\">&lt;\/<\/span><span class=\"html\">PageParserPaths<\/span><span class=\"kwrd\">&gt;<\/span><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/iddles.co.uk\/aggbug.aspx?PostID=6426\" alt=\"\" width=\"1\" height=\"1\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Its taken me long enough but finally had a reason to write some true ASP.Net code.\u00a0 One problem I hit was that trying to run code on a server that is running SharePoint Services &#8230;. so you need this exceprt&#8230;. \u00a0You may see this error: An error occurred during the processing of \/test.aspx. Code blocks [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[17],"tags":[36,37,58,59],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-windows","tag-iis6","tag-iis7","tag-windows-2003","tag-windows-2008","post-preview"],"_links":{"self":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":0,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"wp:attachment":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}