misbaharefin

Stories submitted by misbaharefin

Dependency Injection in ASP.NET MVC3(itworksonmymachine.wordpress.com)

submitted by misbaharefinmisbaharefin(845) 1 year ago

What dependency injection means is that instead of writing code like this in your controller private IBlogService _BlogService; public BlogController() { _BlogService = new BlogService(); } you write code like this private IBlogService _BlogService; public BlogController(IBlogService blogService) { _BlogService = blogService; } the benefits of dependency injection are your classes are not tightly coupled, are more testable, and really is pluggable. To enable dependency injection into your controllers in ASP.NET MVC2 you had to create a new class derived from DefaultControllerFactory and override the GetControllerInstance method to create the controller using your dependency injection container e.g. read more...

add a comment |category: |Views: 19

tags: another

Using ModelMetaData in MVC 2 to wire up sweet jQuery awesomeness(www.lostechies.com)

submitted by misbaharefinmisbaharefin(845) 1 year, 3 months ago

I recently came up with an approach to wiring up some jquery plugins that modify the behavior of standard input text boxes. The approach is not original by any means.I got the idea from the built in client side validation for MVC2, which was inspired by Steve Sanderson's xVal framework. read more...

add a comment |category: |Views: 163

tags: another

Cool site of the day: extensionmethod.net(www.lostechies.com)

submitted by misbaharefinmisbaharefin(845) 1 year, 3 months ago

I was in a meeting today and the topic of extension methods was discussed. I'm a big fan of LINQ - which at the end of the day - is a collection of extension methods on IEnumerable and IEnumerable<T>. I use LINQ all of the time - but I have to profess - I probably don't utilize extension methods as a way of implementing behaviors as much as I should. Looking around the web tonight, I found this site: http://www.extensionmethod.net/. Looks like a nice clearinghouse for extension methods. Next time, before rolling your own, check out this site. Quite likely, somebody else has solved the problem for you. And - you'll likely pick up some good tips!! read more...

add a comment |category: |Views: 3

tags: another

10 URL Rewriting Tips and Tricks(ruslany.net)

submitted by misbaharefinmisbaharefin(845) 2 years, 4 months ago

This post describes some of the tips and tricks that one may find useful when solving URL-based problems for their web server or web site. Each tip/trick has a description of a problem and then an example of how it can be solved with IIS 7 URL Rewrite Module. read more...

add a comment |category: |Views: 14

tags: another

SQL to LINQ Cheat Sheet(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 2 years, 4 months ago

If you are already working with SQL and are familiar with SQL queries then you may find you at time are thinking of converting SQL syntax to LINQ syntax when writing LINQ. Following cheat sheet should help you with some of the common queries read more...

add a comment |category: |Views: 55

tags: another

40+ Essential Front End Web Developer Cheat Sheets(tripwiremagazine.com)

submitted by misbaharefinmisbaharefin(845) 2 years, 5 months ago

Today more or less everyone can put a simple web page together but implementation of professional Web based Application Front Ends is not as simple as some people may think. It is a complex task requiring deep knowledge of several technologies like html, css, javascript, php, etc. In this article you will find essential cheat sheets for the most commen web based technologies that you are likely to use if you’re a Front End Web Developer. First you will find resources covering client side markup and development (html, xhtml, css, javascript, jQuery etc.) and then you will find resoures covering server side development that are to some extent required for Front End Development (php, asp.net, …). read more...

add a comment |category: |Views: 16

tags: another

Select top n rows from a table for each group(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 2 years, 11 months ago

Suppose you want to get the top two products from each manufacturer which have the best promotional price read more...

1 comment |category: |Views: 393

tags: another

Caching Application Block and database backing store(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 3 years ago

Caching can help to overcome some of the challenges associated with enterprise-scale distributed web applications: Performance - Caching improves application performance by storing relevant data as close as possible to the data consumer. This avoids repetitive data creation, processing and transportation Scalability - Storing information in a cache helps save resources and increases scalability as the demands on the application increase Availability - By storing data in a local cache, the application may be able to survive system failures such as network latency, web service problems, and hardware failures read more...

add a comment |category: |Views: 50

tags: another

Kick the DateTime.Now addiction(codebetter.com)

submitted by misbaharefinmisbaharefin(845) 3 years, 1 month ago

Captain Obvious says: "So with time we seem to have two major units that we care about 'Date' and 'Time'." read more...

add a comment |category: |Views: 20

tags: another

Microsoft AntiXSS Library(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 3 years, 1 month ago

The Microsoft Anti-Cross Site Scripting Library is an encoding library, provided by the ASP.NET and Application Consulting & Engineering (ACE) teams at Microsoft, designed to help developers protect their Web-based applications from XSS attacks. XSS can also be called HTML injection attack, it occurs when un-validated user input is inserted into HTML output. This allows the attacker to construct a URL with HTML input and get it executed on the browser in the user's context. This attack can be used to extract cookie information, steal sessions, write new html tags, invoke ActiveX controls, etc. Essentially, anything that can be done with a browser can be done with this attack without the user's knowledge. read more...

add a comment |category: |Views: 24

tags: another

Creating a generic CLR audit trigger(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 3 years, 3 months ago

There’s an interesting article at SqlJunkies about how to create a generic CLR audit trigger. But there is just one small problem with this trigger code. The PerformedBy column of the Audit table in the sample code is set to the UserID of the connection string which in most applications would be the same UserID for all connections because of connection pooling. This means the trigger will log all operations performed by the application but it will not log the real user (application user) who made the change. read more...

add a comment |category: |Views: 90

tags: another

Unity - Dependency Injection and Inversion of Control Container(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 3 years, 5 months ago

Dependency injection is a programming technique to reduce component coupling. Dependency injection is also commonly known as “inversion of control” or IoC or sometimes as The Hollywood Principle - "Don’t call us, we’ll call you”. The goal of dependency injection is to separate the concerns of how a dependency is obtained from the core concerns of a boundary. This improves reusability by enabling components to be supplied with dependencies which may vary depending on context. read more...

add a comment |category: |Views: 366

tags: another

Bug Reporting(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 3 years, 5 months ago

I hate bug reports not because I have an ego and I think I write excellent code which can never have bugs or that I don't want to fix them but because they often leave crucial information to reproduce the bug and/or what was the expected result and why the results are wrong and I end up in a wild goose chase hunting the testers for answers. read more...

add a comment |category: |Views: 5

tags: another

Visual Studio 2008 and .NET Framework 3.5 SP1 RTM is here(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 3 years, 6 months ago

RTM SP1 for Visual Studio 2008 and .NET Framework 3.5 is out and available for download http://msdn.microsoft.com/en-us/vstudio/products/cc533448.aspx Visual Studio 2008 SP1 and .NET Framework 3.5 SP1 significantly improve the developer experience during the development process, and at runtime. These improvements address top issues reported by customers. For more information, see Visual Studio 2008 SP1 and .NET Framework 3.5 SP1. read more...

add a comment |category: |Views: 20

tags: another

Table-Value Parameters in SQL Server 2005(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 3 years, 6 months ago

In pre-SQL Server 2005 in order to pass in a set of values one had to create a temporary table, populate it with data using INSERT, and then just use it in the procedure or function since they are created for the current session and are available to all processes in that session. I did a blog on how to pass in Table-Value Parameters in SQL Server 2008 but what if we have a need to pass in multiple rows of data to a T-SQL statement, or a routine such as stored procedure or function in SQL Server 2005? read more...

add a comment |category: |Views: 216

tags: another

Forms Authentication Timeout vs Session Timeout(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 3 years, 6 months ago

If we set the forms authentication and session timeouts to 10 minutes and after the 10th minute the user clicked on any link the app would redirect the user to the login page but the session was not abandoned i.e. the forms authentication ticket had expired but not the session state timeout. read more...

add a comment |category: |Views: 407

tags: another