Caused by having gridview with lots of textbox inside it.
The solution is to put this into webconfig—>
“<"add key="aspnet:MaxHttpCollectionKeys" value="2001" "/>”
I hope this helps someone because this was hard to find an answer to.
Caused by having gridview with lots of textbox inside it.
The solution is to put this into webconfig—>
“<"add key="aspnet:MaxHttpCollectionKeys" value="2001" "/>”
I hope this helps someone because this was hard to find an answer to.
When working with the AJAX Control ToolKit in WebForms, here is the simplest way to add a wait cursor during AJAX calls.
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(EndRequest);
function InitializeRequest(sender, args) {
document.body.style.cursor = 'wait';
}
function EndRequest(sender, args) {
document.body.style.cursor = 'default';
}
In the world of ASP.NET MVC where the ability to control all areas of your web page is now handed back to you, and immense flexibility is now yours, there is a trade off. The trade off is that now, you have to build much of your inteface yourself instead of using web controls that are found in an ASP.NET web forms. To the rescue are such clientside technologies such as JQuery and KnockoutJs. In this small commentary, I am focusing on KnockOutJS.
The featues of KnockOut that most impress me are automatic dependency tracking, declarative binding and templating. KnockOut uses the MVVM pattern which allows for a a clean separation of concern and simple easy binding of data to your html components. By using Knockout, you avoid using complicated event handlers, as you would do with Jquery, to update various DOM elements when needed. With Knockout, you simply change the underlying data model which automatically ensures that all of the UI elements get updated as desired. Knockout also provides the ability to use templates to dynamically plug in a visual representation of your data. When you have a complex data model that needs to be displayed in an organized fasion, then templates are ideal. When your elements that are bound using Knockout get modified, any changes made to these elements are instantly updated within your template.
This javascript library is really sweet and most definitely has a place in the ASP.NET MVC web developer’s arsenal.
Here are some useful Open Source .NET tools.
1) NCron – .NET Scheduler
If you want to get up and running fast with a .NET scheduling solution that runs as a windows service then this is my choice.
I tried Quartz.Net but it was too bloated and complex. With NCron, I was up and running fast.
The down side is that there is a non-active community and the documentation is poor.
2) ActionMailer.Net – Email from an ASP.NET MVC Controller
If you need to send templated messages such as password reset, over due notices etc then you should give this solution a try.
It is based on the Ruby on Rails solution simply titled ActionMailer. It is very useful to the .NET community.
3) Ninject – Dependency Injection for .NET
If you are interested in using DI then this is the best solution out there bar non.
There are other solutions out there but this one is the easiest to use while being as powerful as other DI solutions.
Cudos to the development team. This is how DI should be done.
4) AutoMapper – A convention-based object-object mapper.. Takes out all of the fuss of mapping one object to another.
Mapping object back to the domain model manually is simple tedious and not worth it. Let Automapper do the hard work.
5) Glimpse – Debug your .NET code with ease.
This is to .NET server what Firebug is to FireFox web browser
After completing an ASP.NET MVC 3 SAAS web application, I’ve come to the realization that ORM using the Entity Framework simply works. The Entity Framework makes interfacing with your backend easy. Developing this application using EF was definitely fun. Learning LINQ was also fun but you have to stop and ask yourself why do I have to learn this strange method of accessing data when I already have SQL? What do I gain? Well what you do gain is a simpler way to insert, update and delete data but the trade off is that you must now master a new framework. Were stored procedures and sql so bad that we needed ORMs?
I do not know for sure because I must say that I do like calling SaveChange() and thus update all changes that occured to the database in one fell swoop. This is convenient. Make all of your changes to any or all tables in the database and then simply call one method to execute these inserts, update and deletes to various tables in the database. There are pros and cons to using or not using ORMs. Rob Conery actually takes the time to explain the issues he has with ORMs. Check it out and let me know how you feel about the issue. I think that many of us who have been around since the 90s have watched the evolution of the Microsoft stacks and have seen things get more complex in one area while at the same time being convenient. Is convenience always best for your customer? Time will ultimately tell us if ORM is a permanent solution or will ORM run into a performance wall?
Check out Rob’s commentary.
Rob’s ORM Commentary
Since ORM is gaining in popularity, I began digging more into the movement. I’ve always been leaning toward it not being a great idea. Because of its popularity now, I decided to see why many are trying to use these ORM tools and whether or not they were successful.
Ted Neward makes a good argument as to why it is not a panacea for developers. This is a very hot and controversial topic.
Before you make the move, listen to the debate between Ted Neward and Oren Eini. The debate was really great!!
Know that there is much to consider before choosing to go with the ORM pattern.
Click Link to Listen
http://www.dotnetrocks.com/default.aspx?showNum=240
Talking Shop Down Under is a really good .NET talk show from Australia. I recommend that you take a listen. The host is very likeable.
Instead of sounding like a .NET evangelist, they often ask real questions and sometimes raise real concerns.
It is a balanced show with many good topics and guest. Real professionals talking about real .NET issues.
Take a listen.
ODATA – Open Data Protocol
ODATA is an implementation of the REST architectural style which uses core features of the web.
REST means Representational State Transfer and is an architectural design that relies on HTTP, URI and HTML. The REST design uses what is already available to the web development community for development. The idea is that we can access resources via an HTTP based web service (NOT A SOAP Web Service) that uses the URI and HTTP. The Uniform Resource Identifier (URI) is a method of uniquely accessing resources on a network and HTTP is the protocol used to request those resources from the URI.
With REST, we use what has been around for years. There is no need to build a brand new messaging protocol to perform actions on resources. This new trend in distribution of data builds on currently accepted standards defined by web standards communities such as W3C. So, to summarize, REST is a way of representing objects/resources which may be accessed using standardized HTTP verbs such as GET, PUT, POST and DELETE; commands known to most developers of web application.
Today, developers of a REST api can implement a REST solution following any standard that they choose. These implementations of a REST api follow no globally defined standard. Well now, with ODATA, we have a defined set of conventions that outline a standardized method of consuming a REST web service. So OData defines how you expose or consume the data in a RESTful way and also helps to standardize on the querying syntax. OData begins the journey of standardizing what a REST implementation should look like. It begins to define protocol specifications for a system that desires to implement a REST api.
REST, by itself is simply an architectural style while Odata is a protocol specification based on a REST architectural style.
There have been Odata client libraries developed for platforms such as .NET, PHP, Ruby, Objective-C, Java and more.
I have been a fan of the REST approach to exposing resources to the public. I think that Odata will make the move to a REST web service more appealing to many. I think that this is a protocol to watch. For more information on Odata, go to http://www.OData.org
A Lambda Expression is known as an anonymous function.
Wikipedia defines an anonymous function as — a function (or a subroutine) defined, and possibly called, without being bound to an identifier
Anonymous functions can be used to contain functionality that need not be named and possibly for short-term use
This function can contain an expression or statement block.
Lambda expressions use a lambda operator which looks like the equal to and greater than sign. =>
The function can take many input parameters that can feed into the expression or the statement block.
For example, the most basic lambda expression is as follows:
(input parameters) => expression
X => X
The scientific world interprets this as saying X goes to X.
It may be better understood by saying X input parameter which returns X value.
This next expression returns a Boolean
X=> X >0 (returns true if X is 1 or greater)
Multiple lambda expressions are separated with a comma.
X and y can be passed as input parameters as follows:
(x,y) => x == y
In this expression we pass two parameters x and y and evaluate them in the expression x ==y.
If X is equal to Y it returns true else false.
You can use a statement block to manage complex expressions.
(x,y) => {
If (x< y)
return (true);
else
return (false);
}
Sometimes you may need to tell the compiler what type you are using. In this example we use an INT for one parameter and a string for the other. The comparison is made between two INTs; the value of X and the length of the string S
(int x, string s) => s.Length > x
Lambda expressions will confuse many when they first see it. But if you intend to be able to understand what you colleagues are doing then you will need to understand this syntax. You may even learn to like it. Be assured, most of the .NET community will be using these expressions.
I must say, at first I did not see the need for it, but short cuts are often appreciated sooner or later.
Whether you like it or not, LINQ and lambda expressions are here to stay. I think that they have a place but use wisely and sparingly.
If you have not noticed yet, the .NET platform is going through a major overhaul. If you have been developing in .NET as long as I have you may find that on the job requirements may get you locked in to what is now called .NET legacy code. Well, I am writing this to let you know that you should pay special attention to these new developments in .NET before you get left behind.
Some of the major changes in .NET seem to often complement one another.
The major changes that you should pay attention to are the implementation of MVC , IoC and LINQ.
MVC
I am not one to jump on any bandwagon that is presented to us by the Microsoft Corporation.
I am still not sold on Silverlight and Windows Azure despite the heavy marketing, but when it comes to MVC, it is the real deal. If you have ever developed web applications using ASP.NET’s web forms, you understand the problems that come along with this method of web development. In the past, developing with web form controls provided quick development but it required you to do things the Microsoft way using their special objects which performed much of the fancy work from behind the scenes. You lost your ability to control what happened within your web page. The Microsoft way became more important than the HTML methodology used by other development environments such as java or PHP. You used things such as ViewState session variables instead of the html hidden controls that are a standard part of HTML.
Back in the early days when you developed web applications using CGI script or even classic ASP, you had total control of your web page and took advantage of many of HTML’s built in features. Well, with the introduction of the MVC pattern and the accompanying Microsoft MVC framework the things that were once considered legacy have returned, although with a better separation of concerns.
CGI was a resource intensive solution that did not take advantage of a web server. Classic ASP was a step in the right direction but lead to poor coding practices. Now, with the MVC framework, you can develop quality application that properly separate areas of concern. The Business layer, presentation layer and database layer are all truly separate. This new approach works toward meeting international web standards compliance and also allows for better code maintenance and application enhancements. Once again you have tight control over the html and http environment.
This technology isn’t new. It has been a major solution for other development platforms such as java and Ruby on Rails. Microsoft has finally begun paying attention and this has provided the .NET community with a better set of tool for developing enterprise applications. My position is that MVC is here to stay and if you plan to continue developing ASP.NET applications, it is a requirement not an option.
IoC
Inversion of Control or dependency injection is a software design pattern that assist you in creating reusable injectable components; meaning that you can easily inject any component you desire without having to recompile your application. Once again, Microsoft was late getting to this party but now they have made a commitment to paying attention to what is happening in the developer community. IoC has been in the Java community for a long time and this is old hat to them but to many in the .NET world it is a new pattern. I often play around in the java world using an open source project called Alfresco. Alfresco has done an awesome job using the Spring framework’s IoC container. This enterprise application makes use of the Spring IoC container and it is very impressive how they have taken advantage of this technology. Once again, this is most likely not optional for developer going forward.
This technology is another must learn for the .NET community.
LINQ
LINQ has really affected the development path of the .NET platform. Many of you who stay on top of .NET development will have noticed that there have been many language enhancements to the C# framework since .Net 3.5 was released. Many of these coding enhancements were introduced to make coding using LINQ much more efficient. Since the introduction of these coding enhancements, you can’t read a developer’s blog or magazine that does not take advantage of these enhancements in their presentations.
Some of these enhancement deal with query expressions, lambda expression, collection initialization and anonymous types. These changes are very advantageous to the .NET developer but it does introduce many newer development concepts that developers will need to get up to speed on.
These changes to the .NET framework are significant and will require many to commit significant time to learn. Although the changes are vast, it is recommended that you begin to get familiar with these technologies. Unlike Silverlight, these technologies are not optional in my humble opinion.