I have a problem. On main server and localhost are the exacly the same files.
But in localhost I have messages in my home language, like
Pole Email jest wymagane.
And on main server I have:
The Email field is required.
As I said, files are exacly the same.
How to resolve it?
Do you happen to have
<globalization enableClientBasedCulture="true" uiCulture="auto" culture="auto">...</globalization>
in your web.config? This would automatically switch the culture of the site to suit the language passed via the browser request i.e. Accept-Language.
If you want to force the language from the server just set enableClientBasedCulture to false.
I had the same problem, the solution for me was to install the correspondant language package in the server (https://support.microsoft.com/en-us/help/14236/language-packs). Inmediatly after that, the validation messages started appearing in the desired language.
Related
I try to deploy ASP MVC 5 app in virtual directory (without creating new iis application)
I use IIS 7.5
I already put
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true" />
in web.config file.
But when i go to app url with IE browser it shows me just directory listing like in screenshot below
Is there a way to deploy MVC 5 in virtual directory and make it work like usual MVC application?
You need to convert the virtual directory to application. Right click on it in the IIS management console and choose Convert To Application.... Also make sure that the associated application is configured to use Integrated Pipeline Mode.
I solved this problem earlier in my production environment by checking the directory pointer in IIS. Apparently when I unzipped the deployed site from one server to the next, the zip utility made an extra level, so IIS was pointing to /MyProject when the files were in /MyProject/MyProject. I had a little better clue though, you have Document Browsing enabled based on that screen shot, make sure not to do that in production. I set the site to log custom errors and got a 403.14 response, from there found a blog on my mistake. You need to setup the environment to find the specific module that's failing, I think something to do with trace routes, idk. I'm a software developer that always gets forced into doing devOps; was googling my own problem and thought I'd throw you a line. Without a specific error message, all I can tell you is IIS is not connecting to .NET; something is not configured correctly. Turn off directory browsing, google how to get good error logs back, and let us know the status code so we can help you: 403.14, 401, 500, 404? Also give us the module that's failing. If it's the last one on the handler list, guess what, IIS isn't connecting to the app, which I suspect is your case.
When I browse to my startpage, e.g. /sv I get a blank page that just says "Default Page". However when I try /sv/ it works. Subpages like /sv/example work without slash though. I'm using Sitecore 7.1 with only MVC views.
Remove the default.aspx file from the web root.
That will fix your problem.
When requesting URLs without a slash at the end, the "StripLanguage" processor of the preprocessRequest pipeline rewrites path to the value of the Settings.DefaultPageName setting ("default.aspx" by default). Since such page physically exists on your site, ASP.NET MVC routing system does not handle such request, and the file itself is served. This behavior is controlled over the RouteCollection.RouteExistingFiles property (false by default), please refer to the following article for the details:
http://msdn.microsoft.com/en-us/library/system.web.routing.routecollection.routeexistingfiles.aspx.
In other case, when a slash is added after a language, this won't happen, since the "StripLanguage" processor does not rewrite the path (which is also not an expected behavior). As a result, request URL does not match the "default.aspx" static file in the site and request is getting processed by ASP.NET MVC.
I suggest you to add the following setting to the "Web.config" file (instead of creating a "default.aspx" page), which points to the "default" page without extension:
<settings>
<setting name="DefaultAspxPageName" value="default"/>
</settings>
After that, the /default URL, without ".aspx" extension, will be processed by MVC and the appropriate item will be rendered independently of a slash after the language URL section.
On my side it works.
I want to point out that the answer to this is not my own but given from the support over at Sitecore who I want to extend a big "Thank you!" to. I had googled this forever until they helped me and I thought that I want to have this document and easily found when others struggle with it. A bug is filed and they are working on fixing it.
DefaultAspxPageName is Hidden Setting.. We can find more such hidden settings..#
http://www.newguid.net/sitecore/2014/sitecore-hidden-string-configuration-settings/
When I start my MVC application and try to sumbit a form with an empty field than validation is fired and the following message appears (german):
Das Feld "Telefon" ist erforderlich.
If i do the same on my bosses computer, the message is
The Telefon field is required.
I checked if out windows settings for region and language are different, but they are the same? What else could be the reason?
EDIT
Solution is to install 'Microsoft .NET Framework 4 Extended DEU Language Pack' (or your perferred language) and to add the culture information in Views/web.config in the <system.web>-Part:
<globalization culture="de-DE" uiCulture="de-DE"/>
On your computer you probably installed the German localized version of the .NET Framework so all error messages are coming from the localized satellite assemblies. Phil Haack blogged about localizing validation messages.
In most browsers you can specify your preferred languages. These can be different from your windows settings.
Check the Accepted-language request header.
I was wondering why could I have not caught this issue in local testing? I am using a Content Panel user control in all my user controls. In one of the user control I missed the register tag for Content Panel UC. While testing locally all things were working fine . Suddenly on our QA box I got a critical issue. Application was throwing Unknown server tag 'cc1:ContentPanel' in the Landing page.
Can anyone explain why it was not caught locally?
Most likely there is a mismatch in your web.config files.
Use a diff program to compare the web.config on QA against the web.config on your box.
I bet you'll find the problem there...
I'm just starting with ASP.NET MVC and I was trying the Authentication with this new architecture.
So, I started following a tutorial in the official site and, while I was trying to add some users through the Web Site Administration Tool, I found this error:
There is a problem with your selected data store. This can be caused by
an invalid server name or credentials, or by insufficient permission.
It can also be caused by the role manager feature not being enabled.
Click the button below to be redirected to a page where you can choose
a new data store.
The following message may help in diagnosing the problem: Could not load type
'MyMvcApp.MvcApplication'.
Now, the only thing I changed in the web.config was the connection string and, I'm sure the connection string is not the problem (is the same I'm using in other project).
EDIT: Here is the connection string: "Data Source=myMachine\SqlExpress;Initial Catalog=TestDB;User ID=TestUser;Password=123456"
I tried several things and googled a lot, but nothing worked.
So, any ideas? as I said, I did not change anything in the web.config besides the connection string.
Thanks in advance,
Found the problem: I just need to COMPILE the solution BEFORE starting the WSAT.
Thanks to everyone for your answers.
Well, like the message says, this feature requires real management enabled, and the default MVC web site template has this disabled. Go into Web.config and change:
<roleManager enabled="false">
to
<roleManager enabled="true">
One other thing to check: Make sure that when you create the SQL Membership Provider metadata you connect as a user who will be useful at runtime. In other words, if you connect as sa, then the metadata will be in the dbo schema. But if you connect as yourself, then the metadata will be in your schema, which isn't necessarily useful to other applications. You should run SQL Server Management Studio in order to verify in which schema the metadata is placed.