I have used FCKeditor in my project. It worked fine before i add url rewriting in my project.
Now i can not upload images from my fckeditor properly.
I am using Intelligencia.UrlRewriter for url rewriting in asp.net.
Can any one help me to get out of this kind of problem?
I'm guessing that the ISAPI rewrite rules are affecting where FCKEditor accesses the necessary html files causing a permanent 404.
Add a rule to exclude the images folder from being rewritten and you should be good to go.
Take a look here for some information about setting rules: http://urlrewriter.net/index.php/support/using
Do you have web.config file? If yes, try these settings in that file
<appsettings>
<add key="FCKeditor:UserFilesPath" value="~/UserFilesUpload" />
</appsettings>
Related
I'm using the following code these days to include my JS and CSS files within my (Umbraco) websites:
#using ClientDependency.Core.Mvc;
#{
Html.RequiresCss("link-to-file", 1);
Html.RequiresCss("link-to-file", 2);
Html.RequiresJs("link-to-file", 1);
}
I've noticed that the following files is being called when loading the site:
https://mysite.nl/DependencyHandler.axd?s=L2xpYi9zY3JpcHRzL21vZGVybml6ci5jdXN0b20uanM7L2xpYi9zY3JpcHRzL2pxdWVyeS5kbG1lbnUuanM7L2xpYi9zY3JpcHRzL3NpdGUuanM7&t=Javascript&cdv=1511701721
After making changes to either the CSS or JS files and uploading them to the server, the DependencyHandler call remains the same. Therefor, the CSS and JS are being cached on the server and I don't see my changes on the live site.
I need to manualy change the ClientDependency version (within ClientDepenedency.config). If I change that, the 'cdv' value at the end of the DependencyHandler call is changed (to the version I changed it in ofcourse), and the new files are being served.
Is there a way to get the DependencyHandler notice changes in the files and automaticly refresh the cache?
If anyone is still ask this question, as a response, you can enter
Shift+F5
on search engine.
Maybe, it is a response this question.
By the way if you were doing <compilation defaultLanguage="c#" debug="true" ...> in Web.config, you can look js or css files.
If this problem isn't cache problem, should been controled server connection, services,.. Except that, if it is a OOP's problem, wouldn't umbraco throw a mistake? As I said, I understood this text as a cache problem and I response as it.
Hope it work.
I'm trying to figure out how the easiest way would be to force endusers browser to clear cache.
We are working in visual studio with .Net WebForms and AngularJs
So every time we deploy our .Net project to test or production enviroment we got problems with cache saving old javascript and hides new implementation...
I know a couple solutions but I wanna see if there are any other?
Thanks in advance!
Right click in this page and select view source, you will see static files suffixed as follows:
<script src="//cdn.sstatic.net/Js/stub.en.js?v=b1fcfe635df7"></script>
Basically this is kind of the best method, generate some suffix and append that to the end of all of your static files as a querystring parameter. That will force the browser into thinking that the file is new, i.e. if the querystring has changed...
The rub here though is how often do you change those files... how often do you want to force the user to download new static files... using a generated timestamp could force the user to download the file everytime they visit the site, often not ideal.... Maybe use the web.config date or something like it.
you can add below settings in web.config to disable caching
<system.webServer>
<staticContent>
<clientCache cacheControlMode="DisableCache" />
</staticContent>
</system.webServer>
Can anybody tell me what is the best way to perform URL rewriting for an individual product page which is used to show a particular product pulled from a SQL Server database. For example the original URL could be:
webaddress.com/products/view-product.aspx?id=76
But I would like to make this URL available
webaddress.com/products/manufacturer/productName
I am aware of defining normal pages in the web.config file like the following:
<system.web>
<urlMappings>
<add url="~/products" mappedUrl="~/products.aspx"/>
</urlMappings>
</system.web>
But how do you achieve this for dynamic pages?
After a bit more research I have managed to do this.... For your information, this article explains the process beautifully!
I found this link. Very cool. That shows how you can store appsettings in a different file:
http://sureshbeniwal.blogspot.com/2008/04/store-appsettings-in-external-file.html
Can I do the same thing with ConnectionStrings tag?
Can I do the same thing with web service links?
This is a web application so the web links are in this format:
<applicationSettings>
<Webstrat.Web.Properties.Settings>
All configuration section elements (such as connectionStrings etc) have the configSource attribute, as discussed on MSDN. This allows you to specify a separate file for inclusion, but not in the way you have shown.
Example:
<connectionStrings configSource="connectionStrings.config" />
Yes for connection strings. I have done it numerous times. Have not tried for web links, but you can check the schema for config and see if there is a file attribute for the settings. Since this appears custom, the answer depends on whether or not they coded the possibility in.
using the configSource attribute works for most elements in the config file. I would recommend using that method instead of the file attribute in the example you posted.
This is a bit tricky and I'd be glad if you guys could give me some pointers on this one. Here is what I want to do:
A user tries to access
myapp.com/data/123456.mp3
test.mp3 doesn't exist
The system sends the user to
myapp.com/data/error.apsx?file=123456.mp3
I need this in order to handle the way a large system is supposed to serve mp3 files.
If a user tries to access myapp.com/otherFolder/notHere.whatever, the system returns the standard 404 error normally.
I know there are ways to specify that in IIS, but I'd love it if there was something I could do programmatically or just withing my .net project.
edit:
I've created a web.config file in myapp.com/data/
<?xml version="1.0"?>
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="/data/mp3/full/serveMp3.aspx"/>
</system.web>
</configuration>
This doesn't seem to be working.
Custom Errors
http://aspnetresources.com/articles/CustomErrorPages.aspx
In your web.config.
<customErrors
mode="RemoteOnly"
defaultRedirect="~/errors/GeneralError.aspx"
/>
The first thing you have to do is make sure ASP.NET gets to handle these file requests since by default .mp3 isn't an ASP.NET extension and this will just be handled by IIS.
Couple of ways to actually do this once you are handling it spring to mind.
The first is to create an HttpModule which watches the OnUnhandledException event. Since ASP.NET throws 404's (and all HTTP errors) as HttpException type exceptions the module will provide you with a place to catch, parse the request, and redirect to your own ends.
The other means is to create a web.config at the folder level you care about (these can be nested remember) and create customerror section there. This is more straightforward but affords much less control. All things considered I would favour the module generally.
probably you could put a web.config indide the folder that you want to put a specific error and put in that webconfig the customerror tag with the page indicated
or you can use the location tag inside the main web.config
but i'm not sure about this