In ASP.NET MVC you can render data from partial views by using RenderPartial, Partial,
RenderAction or Action.
At times this can be confusing. In this article we look at the different methods in a little more depth
to try and clarify why and when you would use which method.
Saturday, January 26, 2013
When to use RenderPartial, Partial, RenderAction or Action in MVC
Labels:
Action
,
C#
,
MVC
,
MVC3
,
MVC4
,
Output Caching
,
PArtial
,
RenderAction
,
RenderPartial
Tuesday, January 22, 2013
Migrating to jQuery 1.9
Wednesday, November 28, 2012
jQuery: Retrieving thin, medium or thick border settings
This post is about extracting the border-width of an element when it is set to thin, medium or thick using jQuery.
jQuery has several methods available to us to retrieve the width of an element such as width(), innerWidth(), outerWidth() and outerWidth(true).
Even if this post only focuses on the width, the same applies to the height as well off course.
For a more detailed look into each of those method see my previous post on jQuery: height, width, inner and outer
jQuery has several methods available to us to retrieve the width of an element such as width(), innerWidth(), outerWidth() and outerWidth(true).
Even if this post only focuses on the width, the same applies to the height as well off course.
For a more detailed look into each of those method see my previous post on jQuery: height, width, inner and outer
Content
- The most general case
- Where is the problem?
- Fiddle to play with
- How can I calculate the border-width reliably?
- Additional Resources
Labels:
border-with
,
borderLeftWidth
,
Chrome
,
CSS
,
FireFox
,
IE
,
IE7
,
IE8
,
IE9
,
innerWidth
,
JavaScript
,
jQuery
,
medium
,
outerWidth
,
thick
,
thisn
Tuesday, September 25, 2012
jQuery CDN Fallback - What if the CDN is down?
In your website you are using a reference to a jQuery library from a popular content delivery network (CDN).
As you know, one of the benefits of using a CDN is that users visiting your page may not have to download the jQuery file every time they visit your site.
Other benefits are that they have high availability and perform very well.
However, on the rare occasion a CDN could be down or the provider could have general connectivity problems. Providers such as Google or Microsoft are not impervious to those problems, they can limit the effects but still, you can end up in a situation in which the CDN you are pointing to is unable to supply you with the file.
As you know, one of the benefits of using a CDN is that users visiting your page may not have to download the jQuery file every time they visit your site.
Other benefits are that they have high availability and perform very well.
However, on the rare occasion a CDN could be down or the provider could have general connectivity problems. Providers such as Google or Microsoft are not impervious to those problems, they can limit the effects but still, you can end up in a situation in which the CDN you are pointing to is unable to supply you with the file.
Labels:
CDN
,
Fallback
,
JavaScript
,
jQuery
Monday, September 17, 2012
jQuery: height, width, inner and outer
When using jQuery you have several methods at your disposal to retrieve the height and width of an element.
Content
Labels:
height
,
innerHeight
,
innerWidth
,
jQuery
,
outerHeight
,
outerWidth
,
width
Thursday, September 13, 2012
Does it matter which CDN you use for jQuery?
There is a very interesting article regarding the quality of Content Delivery Networks (CDN) of different providers published on royal.pingdom.com.
Does it really matter which CDN you use? We know that if we pick the CDN which is more popular that the chance a user has to download the file when visiting your site is slimmer.
You might be a little surprised to learn that there is more to it than just popularity.
Pingdom has performed tests on the 3 most commonly used free CDN hosts; Google, Microsoft and Media Temple. Media Temple being the official host of jQuery.
To evaluate the networks, Pingdom performed tests from multiple locations across Europe and North America, once per minute, 27/7 for 30 days.
Does it really matter which CDN you use? We know that if we pick the CDN which is more popular that the chance a user has to download the file when visiting your site is slimmer.
You might be a little surprised to learn that there is more to it than just popularity.
Pingdom has performed tests on the 3 most commonly used free CDN hosts; Google, Microsoft and Media Temple. Media Temple being the official host of jQuery.
To evaluate the networks, Pingdom performed tests from multiple locations across Europe and North America, once per minute, 27/7 for 30 days.
Labels:
CDN
,
Content Delivery Network
,
Google
,
jQuery
,
Media Temple
,
Microsoft
,
performance test
,
pingdom
Wednesday, September 12, 2012
jQuery implementing show more - show less
This is a small tutorial on how to create a show-more and show-less feature.
In this example we will be using jQuery's
In this example we will be using jQuery's
toggleClass() to toggle between class objects. We will also be using jQuery UI's switchClass() for adding animation when toggling classes.
Content
- Base HTML
- Minimum CSS
- Using jQuery's toggleClass()
- DEMO: Show More, Show Less
- Using jQuery's switchClass()
- DEMO: Adding Animation
- Additional Resources
Labels:
click
,
events
,
jQuery
,
jQuery UI
,
on
,
show-less
,
show-more
,
switchClass
,
toggleClass
jQuery 2.0 - Bye Bye IE6, 7 and 8 support
With jQuery 1.8 only recently released at the end of August you might be wondering what is so interesting about jQuery 2.0, given 1.9 is planned to only be released early 2013.
According to the jQuery blog it currently is planned for jQuery 1.9 to be released some time early 2013 as a continuation to 1.8.
However, there will also be the jQuery 2.0 release shortly after jQuery 1.9.
The difference between 1.9 and 2.0 is that jQuery 2.0 will no longer support IE6, IE7 and IE8.
According to the jQuery blog it currently is planned for jQuery 1.9 to be released some time early 2013 as a continuation to 1.8.
However, there will also be the jQuery 2.0 release shortly after jQuery 1.9.
The difference between 1.9 and 2.0 is that jQuery 2.0 will no longer support IE6, IE7 and IE8.
Labels:
IE6
,
IE7
,
IE8
,
jQuery
,
jQuery 1.9
,
jQuery 2.0
,
support
Tuesday, September 11, 2012
jQuery: Event handlers
They are several methods for attaching and removing event handlers within jQuery.
As of today the latest version is 1.8.2 and we have available to us:
As of jQuery 1.7 on() and off() are the preferred methods for attaching and removing event handlers, replacing all other methods.
As of today the latest version is 1.8.2 and we have available to us:
- shortcuts, such as click(), blur(), change() and others
- bind() and unbind() - added in version 1.0
- delegate() and undelegate() - added in version 1.4.2
- on() and off() - added in version 1.7
- one() - added in version 1.1
As of jQuery 1.7 on() and off() are the preferred methods for attaching and removing event handlers, replacing all other methods.
Content
- Shortcuts
- Binding and Unbinding
- Attaching events to dynamic elements
- The one()
- Does it matter which method I use in the end?
- Additional Resources
Monday, September 10, 2012
Design Patterns
If you are a software developer who is new the concept of design patterns or still pretty novice, like myself in the subject, than I hope this post will help you to get a good overview.
Content
Labels:
christopher alexander
,
design patterns
,
gang of four
,
Kent Beck
,
Ward Cunningham
Subscribe to:
Posts
(
Atom
)