Cannot browse to node/folder name without extension in Umbraco - asp.net

I'm using IIS7 and Umbraco 4 to run a clients site but I'm having issues browsing to pages with extensionless URLS.
The site is running several languages which are separated by Umbraco Folders. What I want to do is use the primary domain (.com) for all sites and request a specific one using the abbreviated country name i.e. mydomain.com/es (for spanish site). The trouble is I can only access the page by using the .aspx extension i.e. mydomain.com/es.aspx and without the extension i get a 404 error.
It's been suggested that I add the page I am requesting as a default dosument in IIS but this has not worked.
I've also tried setting the "umbracoHideTopLevelNodeFromPath" value to false but this makes no difference.
The system will be migrated to the clients servers once complete so I don't really want to add URL rewriting rules within IIS so is there anything I've missed which will allow me to do this?
Thanks

so, you want to browse with directory url's then,
this is very mutch possible.
first, open your web.config
find the line below, and make sure the value is set to true
<add key="umbracoUseDirectoryUrls" value="true" />
then, you will need to add a wildcard mapping in IIS
the steps you will need to take in IIS7 are explained in this post:
[http://learn.iis.net/page.aspx/508/wildcard-script-mapping-and-iis-7-integrated-pipeline/][1]
and if you would ever need to do this on IIS6
Open IIS6
Right click on your website
Select Properties
Click the home directory tab
Click Configuration
On the mappings tab, click the Insert button, next to the wildcard mappings box
Click Browse and find the aspnew_isapi.dll, this can usually be found here:
c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll
Untick verify that file exists and click OK
Click OK
Click OK
Done
[1] : http://learn.iis.net/page.aspx/508/wildcard-script-mapping-and-iis-7-integrated-pipeline/

I know I'm a bit late in this one but if you want to have a directory NOT handled by Umbraco, try editing your web.config. Under the node, append your folder name to the existing value for umbracoReservedPaths. After the application restarts, you should be able to enter your folder and it will bypass the Umbraco handler.
<configuration>
...
<appSettings>
<add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/MyFolderName/" />
</appSettings>
...
</configuration>

Related

Rich text editor with standalone apps under Sitecore web root

I've been trying to configure a standalone ASP.Net application beneath a Sitecore web root (more or less as outlined here: http://sitecoreblog.alexshyba.com/2009/05/standalone-apps-under-sitecore-web-root.html). It's almost successful in that the virtual directory runs, but in the /sitecore folder, the rich text editor no longer works. Here is the error it throws:
'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager.
It works fine when I revert back to the original configuration.
Does anyone know how to properly configure this?
More info (1):
So, in the sitecore web.config, at the root, I added:
location path="." inheritInChildApplications="false" above the sitecore, system.webserver, and system.web nodes. The non-sitecore app I was attempting to run works great when I do this, but it somehow creates the Telerik.Web.UI.WebResource.axd I mention above, in the /sitecore folder, mostly when using the rich text box.
More info (2): This happens when I make these changes to the web.config in the sitecore root. While attempting to fix the problem, I did make a few changes to the web.config files in the /sitecore folder (including deleting them). but it made no difference. I've since restored the /sitecore folder to it's original configuration.
The standalone app is running as a separate app, immediately off the root, so: http://mysitecoresite/mystandaloneapp.
I had the same problem. After much searching, this fixed it for me (using v7.2 rev 140228): http://docs.telerik.com/devtools/aspnet-ajax/controls/scriptmanager/troubleshooting/overview#telerikwebuiwebresourceaxd-is-missing-in-webconfig-radscriptmanager-requires-a-httphandler-registration-in-webconfig
You have to set the EnableHandlerDetection property where it is declared on the Sitecore .aspx pages. I found it on EditorWindow.aspx and EditorPage.aspx.
<telerik:RadScriptManager ID="RadScriptManager" runat="server" EnableHandlerDetection="false"></telerik:RadScriptManager>

dynamic web.config appsetting

I have a web application that we publish and provide for users to install and run on their local network. They choose whether they run it as an internet, or intranet application.
When we publish the application we label the folder with the publish date (e.g. 20140815) so we know which version they have. However, when they contact support, it is a pain for them to get on the server to see the folder information.
I want to add an appsetting for cloudVersion and display it on the license page so they can easily provide it from wherever if needed. Also, they feel better seeing the version increase so they know they are getting value with the service contract.
<add key="cloudVersion" value="20140815"/>
I would like to automate the version in the appsettings. I was hoping I could use a Web.Config transform to set it with a dynamic yyyymmdd, but can't see how to do that and have found nothing in my web search.
<appSettings>
<add key="cloudVersion" value="GETDATE()" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
</appSettings>
Is this possible? If so, how? If not, is there a better approach to achieve the same result?
Short of finding a great solution for this, I have elected for the following:
After publication, I run a bat file that does the following:
copy the published directory and rename with today's date
update the Web.Config appSetting value
compress the updated directory using 7zip
upload the compressed directory to Google Drive so my support team can provide it to our users.
You can see how I modified the string here:
bat file to modify web.config setting

Is there a stable ASP.NET blogging control (designed for integration within existing site)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I saw dotnetblogengine.net and from forum posts I got the impression that it's not so easy to integrate it into existing site. Is there a modern blogging/news solution which is meant to be used just like any other ASP.NET control?
Please find the step by step guide how to integrate this existing application. Moreover also you find the solutions to integrate with asp.net application as there is some complexities involved in integrating this BlogEngine web site project with asp.net web application. You can just follow below instruction then it is done.
Get the web project folder
Now that you have a downloaded zip file, you need to un-zip it. This can be done with a bunch of different utilities and in a bunch of different methods.
If you choose the Web Project download, your newly unzipped folder contains the web project you want to work with. If you download the source code, the web project is buried a little bit. The web project is found under the BlogEngine.NET folder, then the BlogEngine folder.
Load the web project on your web server
Now that you have the web project folder, copy those files and folders out to your web server. This usually involves FTP, but depending on your situation, it might even require a portable storage device (e.g. USB flash drive).
Set folder as a .NET 4.0 application
There isn't much to say about this. If you have direct IIS access, you need to create an application. If you are using a hosted provider, you need to use their control panel to make this happen. It should be a standard option, but if you don't find it, you may need to contact your hosting provider for support.
Add write permissions for App_Data folder
This is an often forgotten step. If you miss it, you'll notice as soon as you try to make a change. You need to give the application write permissions to the App_Data folder. Again, your hosting provider may have a control panel that allows you to do this. If not, you may need to contact your hosting provider for support.
Setting write permissions could involve up to 3 steps:
Using the IIS admin tool or your hosting provider's control panel, set the folder as "Write" capable;
If you have direct access to the file system, make sure the account under which the BlogEngine.NET's application pool is running (typically "ASPNET" on XP / 2003 and "Network Service" on Vista / 2008) has write access to the physical folder;
After unzipping the web folder, all files have their read-only attribute enabled. Turn that attribute off for the App_Data folder and all files and sub-folders.
Navigate to the web page
Ok, now you are ready to navigate to the web site and see how you did. For example, if you installed the web site to your local machine for testing, you would navigate to http://localhost/default.aspx. You can also edit the default document to display to default.aspx using the IIS MMC snap-in. If you do this, you can navigate directly to http://localhost/ without specifying the page name. If all goes well, you are greeted by the default blog page.
Login and Setup your user name
The last step is to scroll down and find the sign in link on the right side. Click Sign in and then login in the following information.
User Name: admin
Password: admin
Once you login, you will see a new menu on the right hand side. Click Users.
Create a new user for yourself. The user name you choose is your display name. See the User Administration page for more information.
Delete the admin account. You don't want everyone who reads this to be able to login to your blog, do you?
Finally, log out, then log back in using the user account you just created for yourself.
The above installation is for, if we want to run the blog as a stand alone site which is rare specially in our case, **so lets include our blog within our site so that we will not have to redirect to another site to just go to the Blog or from blog to the main web site.**enter code here
Include the Blog Engine site to our own Project:
Create a folder inside root named Blog or as you want to name it. Copy the whole Blog Engine .net site inside this folder except App_Global Resources,App_Code,Web.Config, robots.txt, web.sitemap and Global.asax.
Rename the App_Code folder to BlogApp_Core or as you want. Because App_Code folders will not work with web application as they work with the web sites. Now Copy this folder to the Root of the project.
Merge or Copy the App_Global Resources robots.txt and web.sitemap to the Root of the project.
Add the Blog Engine.core project in the Web Application. Build Blog Engine.core and add reference from your web project to “BlogEngine.Core.dll”.
Web.Config Changes
If you already have a web.config in place then merge the Blog's Web.Config with it otherwise just copy it to the root. Go to the line in pages section:
change that to:
<add assembly=”BlogWap” namespace=”Controls” tagPrefix=”blog”/>
where BlogWap is the Web Project Name. Go to the line:
<add key="BlogEngine.VirtualPath" value="~/" />
change this to:
<add key="BlogEngine.VirtualPath" value="~/Blog/" />
where Blog is the Folder name that we have created earlier.
If you want to use SQL As database we have to go for some more changes
Changes for using SQL as DB
Execute the Setup inside setup/SQLServer at your Sql to automatically generate the Tables. If you want to use ASP.NET Membership then you can delete the be.Users and be.roles tables.
Change the connection sting according to your DB where name="BlogEngine".
Change the line:
<blogProvider defaultProvider="XMLBlogProvider">
to:
<blogProvider defaultProvider="DbBlogProvider">
Change the line:
<membership defaultProvider="XMLMembershipProvider">
to:
<membership defaultProvider="SqlMembershipProvider">
Change the line:
<roleManager defaultProvider="XMLRoleProvider" enabled="true" cacheRolesInCookie="true">
to:
<roleManager defaultProvider="SqlRoleProvider" enabled="true" cacheRolesInCookie="true">
Right Click on the Project and click on Convert to Web Application.
now you will think we are done with the web site to web applicatication conversion but wait there is some issues with the Blog Engine .NET 2.0 version while including it inside our project now we have to edit the Files inside the project to get it work.
Search for ~/admin at web project level and replace it with ~/Blog/admin Blog is our folder name.
And same for ~/widget ~/themes and ~/pics.
Open the file ~/blog/pages/settings.aspx.cs and go to line 262 in method BindCultures() and change the following line from:
string path = Server.MapPath(Util.AbsoluteWebRoot + "App_GlobalResources/");
to:
string path = Server.MapPath("~/App_GlobalResources/");
Open the BlogEngine.Core project and go to the Utils.cs. Now search for CodeAssemblies() function here we need to change the assmebly:
var assemblyName = "__code";
Change this line to:
var assemblyName = "WebProjectName";
and:
else
{
if (!IsMono)
{
assemblyName = "App_Code";
}
to:
else
{
if (!IsMono)
{
assemblyName = "WebProjectName";
}
Go to the function :
AddFolderJavaScripts()
Change
var fileEntries = Directory.GetFiles(HostingEnvironment.MapPath("~/" + pathFromRoot))
.Where(file =>
!scriptsAddedDuringRequest.ContainsKey(file) &&
file.EndsWith(".js", StringComparison.OrdinalIgnoreCase) &&
!file.EndsWith("-vsdoc.js",
StringComparison.OrdinalIgnoreCase)).ToList();
to:
var fileEntries = Directory.GetFiles(HostingEnvironment.MapPath("~/Blog/" + pathFromRoot))
.Where(file =>
!scriptsAddedDuringRequest.ContainsKey(file) &&
file.EndsWith(".js", StringComparison.OrdinalIgnoreCase) &&
!file.EndsWith("-vsdoc.js",
StringComparison.OrdinalIgnoreCase)).ToList();
Now Check the files inside Blog/admin folder here you have to check for the namespace actually they have messed up the namespace may be it will be fine in the further releases. You have to also check for the Case of the letter like Admin and admin. Fix all the name space problem.
Do a global Search for ~/App_Code and replace it with ~/Blog_App_Code or whatever you have named your App_code Folder.
Build the project and Run now your application should work fine go to Blog Try to add Blogs Delete Blogs wait hey what happened you can not delete the blogs ohhh My God what is going wrong hmm so searching for a solution and finally got the problem :).
So here is the solution. Actually deletion is through asmx which we are calling internally from js so we will have to check the path inside js file that, it is having the correct path to the asmx files or not, the best way is to add the following lines to your site.master and admin.master
<script type="text/javascript">
var fullBaseUrl = '<%=ResolveUrl("~") %>';
</script>
and use this fullBaseUrl variable inside your admin.js file which was having problem. And we also have to add the following 2 lines to the Web.config under handlers section to make these asmx files to work:
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Now it is time for checking that every thing is working fine or not so go ahead build the project and browse wow its working fine awesome finally we did it, but after a rigorous testing got to know that, still we are having some issues which I got after a long gap :( and this was with the media files as we can see we are having option to upload video files to the posts and pages the upload will work fine but when you will go to that post there will be no video just a black box ohh again I am stuckkkk but hey we are software engineers never get scared of a problem just have the confidence in yourself and go ahead,so lets explore and as we know if there is problem there is a solution :) oh wow got the solution
Go to Blog/admin/EditPage.aspx.cs ohh they have hard-coded the path here, so that was the problem
Search for the function:
BtnUploadVideoClick(object sender, EventArgs e)
Change:
var folder = "~/" + mediaFolder + "/";` to `var folder = "~/Blog/" + mediaFolder + "/";
We have to do the same once again for post and you will find this inside Blog/admin/post/Add_entry.aspx.cs in BtnUploadVideoClick(object sender, EventArgs e) {
Build the solution again and browse
Hey finally we got our Blog running perfectly :)
We can also add Facebook and twitter for sharing the post through twitter and facebook I have just attached one file to our BlogApp_Code/Extensions folder to implement this functionality, after that built the project, browsed it, and the magic is there when we will go to your post we will get facebook and twitter share option just below your post.
We can also create our own theme in Blog Engine .net by just following some rules. So congrats we are done with the integration of BlogEngine.net inside our web site with visuals similar to our site. Now upload post add pages to the Blog share your thoughts use Blog for your business and have fun do what ever you want :).
Conclusions
AS an ASP.NET Developer Blog engine .NET is the best Open Source Blogging tool with few minutes easy installation.Play With the Code and make it work according to your requirements. Just need to take care of some points to make it work inside our project.
Bibliography
http://www.upfromthesky.com/blog/post/2009/01/30/Integrate-BlogEngine-145-into-an-exisitng-website-%28VSNET-Website-Project%29.aspx
http://blogengine.codeplex.com/documentation
Refer these sites for customization. For creating our own themes:
http://blogengine.codeplex.com/wikipage?title=ThemeCreation
For Creating our own Extensions:
http://blogengine.codeplex.com/wikipage?title=Extensions&referringTitle=Documentation
For Creating Our own Control:
http://blogengine.codeplex.com/wikipage?title=CreateNewControls&referringTitle=Documentation
Dasblog on codeplex is easily integrated. Scott Hanselman actually uses it for his blog http://www.hanselman.com/blog
http://dasblog.codeplex.com/
Best bet with BlogEngine is to set it up as a sub-domain of your existing site and re-skin the CSS to match your existing design. Here's an example of where I used that approach:
http://homenetdirect.com
http://blog.homenetdirect.com/
A blog has just too much to it to be implemented as a control IMHO. However, you could easily create an admin for a simple news panel with title and date on top and database it.
BlogEngindotnet is so much easy to build your blog, you just need to
download the latest version ,
run the database script available in source code,
change connection string pointing to database,
upload on subdomain, that's it!
If you need free blogging then use blogger provided by google.

Unable to access SQL reporting services on shared site with Themes enabled

I am having some trouble with my IIS web server & SQL reporting services.
At the current time my site is playing host to both reporting services (/reports & /reportserver) as well as my personal website (domain.com)
Only just recently have I implemented a Theme on my site and as such I have placed a statement in my web.config file directing it to apply a certain theme in the following manner:
<pages styleSheetTheme="General">
Because of this when I try to access the report pages it fails, telling me it couldn't find the Theme. So, what I did was locate the source files for the /reports & /reportserver directories and placed the App_Theme folder in them hoping that would sort everything out.
What I am getting now is the following error:
**Using themed css files requires a header control on the page. e.g. head runat="server" **
Does anyone know how I can get around this? Do I have to hack the SQL reporting aspx pages? Please note I do NOT want to remove the web.config declaration.
Don't have the /reports & /reportserver as sub folders of the main website.
I found the answer on another forum. You have to set the following for the nested web.config file (the one for reporting services) to...
<pages validateRequest="false" styleSheetTheme=""/>

How to configure IIS 6.0 to use both default content page and wildcard application maps

In the filesystem I have
/file.aspx
/directory/default.aspx
I want to configure IIS so that it returns the appropriate file (add the aspx extension) or directory (default content page) as follows:
/file -> /file.aspx
/directory -> /directory/default.aspx
/directory/ -> /directory/default.aspx
I have configured the Wildcard application mapping set to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll. When the "Verify that file exists" is unchecked, the the file request works but not the directory request (returns 404). When the "Verify that file exists" is checked, the directory request works but not the file request.
How can I configure it so that both the file and directory requests will work?
I recommend using UrlRewriter:
http://urlrewriter.net/
This allows you to create all the mappings above that you desire. One thing that you'll have to do (if you're using IIS 6 or earlier) is configure IIS so that all extensions are handled by asp.net. The documentation explains how to do this. Then you create a bunch of rules in your web.config (or separate rewriter.config as I use) in the form of regular expressions to create your mappings.
Incidentally, for the above example, you probably don't need to do anything for the last two rules. IIS will take care of those automatically. For the first rule it will be something like:
<rewrite url="^/file$" to="/file.aspx" />
You could get more clever and write generalized rules so you don't have to write one rule per file.
You'll have to add an ASP.NET global.asax or HttpModule that maps the / request to default.aspx.
I looked at url rewriting, but ultimately decided on a simpler solution. I just moved the file.aspx into a directory and renamed it to default.aspx.

Resources