Hey, I just wanted to ask you if there is any solution to implement the namespaces which are usually served by the Web.config file. I have to call methods from Razor but i can't since i don't have anything to call.
The problem is deal with globalization. So i recommend you to follow Hansleman post http://www.hanselman.com/blog/GlobalizationInternationalizationAndLocalizationInASPNETMVC3JavaScriptAndJQueryPart1.aspx
In the jquery.validate.js, find range: function et number: function and replace like that :
range: function (value, element, param) {
var globalizedValue = value.replace(",", ".");
return this.optional(element) || (globalizedValue >= param[0] && globalizedValue <= param[1]);
//return this.optional(element) || ( value >= param[0] && value <= param[1] );
}
I may be missing the obvious, but where can I download this tool?
The referenced download section is empty.
I found the source area, but do I really first have to install Mercurial, download the source, obtain VisualStudio and install it, compile the whole thing, etc.? No easier way to try out the tool?
This is awsome, I came upon so many different and complicated proposed solutions and I spent two hours before I found your great article. You saved me!
If you ever come to Serbia, I promise you a free beer or rakija(great national drink)!!!
Glad to read this post, I have the exact same thoughts. I didn't write lot of code those last three years, but dug into the last frameworks to keep up-to-date, and for some small projects.
My thought is that each time I try to use modern frameworks, I just pull my last hair off because those try to make things easy, but for a small detail I loose even more time to try to find an inelegant workaround.
This applies to MEF which doesn't let me choose which plugins I want to instanciate, and how many times each, or Linq to SQL which doesn't let me map by code the table names, I forgot the others.
I don't want to create XML mapping files to handle with after deploying an application, I want to pass a string argument in the constructor of my object, which it will be using then to prefix the table names, that's not so complicated !!!
I read in your last comment that there is a good way to prefix easily in EF, could you post a link to an article or other documentation about that to help me get started ?
Hello LennardG,
I do have problems with replacing the GetWebRequest.
Is there some additional trick to override the method if it is generated via ServiceDescriptionImporter ?
This is a great article and I have used it in my applicaiton.
I have a slight issue though, maybe you can help me with it.
I have used your example to pull the views from the database. They are pulled in fine, but they have no layout associated with them. I have tried specifying a layout but it get an error "The view 'Guidelines' or its master was not found or no view engine supports the searched locations. The following locations were searched:".
How can I get it to just continue using the current layout?
I will try to implement this post using MVC 3 + RAZOR + caching and also trying run the controller by some kind of F# "Engine", to make a easy to go approach... this post gave me useful crazy ideas =)
Thanks for the link, I will check it out, although my Linq to SQL usage has dropped to zero in favour of EF.
I actually had been using Entity Framework a lot lately. When using code first Entity Framework, you can create table prefixes easily, just by overriding the entity names when the model is being created (OnModelCreating() method of the DbContext.
I am not sure how to achieve the same when you use the designers though.
It is indeed possible, although I would advise to create a brand new validator class that you can use. I might do a blog post on that actually in the coming days.
It had been a long while since the post so I am not sure if you are still looking for a solution to dynamic table name problem with LINQ.
Any way, I have just found a solution recently and like to share it with you. Check it out "http://www.codeproject.com/Articles/333249/Dynamic-Table-Mapping-for-Linq-to-SQL"
Alex, are you sure you have included jquery.validate.js (or the .min version) and jquery.validate.unobtrusive.js (or the .min version)? Before you use the code I showed in the article?
In the newer ASP.NET MVC project templates, these files are not included in the _Layouts.cshtml (for Razor) file. Instead, they are referenced from individual .cshtml files when you generate an editor template (or something that required validation)?
If you use the default generated way, you need to add the code in my article AFTER those includes.
Jannik, automatic properties have been around since C# 3.0 (.NET 3.0). I did not really point out which version of the code was written for. If you are using an earlier version of the .NET Framework (1.1 or 2.0), you will need to define a backing field for the property as follows:
private int _processorAffinity;
public int ProcessorAffinity
{
get { return this._processorAffinity; }
set { this._processorAffinity = value; }
}