Ramani Sandeep's Blog

DotNetting – Fast , Easy Way of Developing Applications

Archive for the ‘ASP.NET MVC’ Category

Using jqGrid’s search toolbar with multiple filters in ASP.NET MVC

Posted by Ramani Sandeep on March 23, 2010

This article describes how to use jqGrid’s search toolbar with multiple filters in ASP.NET MVC.

Introduction

Very often, we have a requirement to display data in tabular form and manipulate it. In classic ASP.NET, built-in controls are available. It’s always better to use custom scripts to solve this problem in ASP.NET MVC. jqGrid is one of such solutions.

Background

jqGrid is a plugin for jQuery, which allows you to display data in tabular form with greater functionality. Its features include:

  1. Supports tables within tables
  2. Supports data editing
  3. Supports tree-like structure to display data
  4. Supports themes on the jQuery UI
  5. Records searching, filtering of each column, sorting by columns, page navigation, etc.

You can read full article with example here.

Hope this will help !

Jay Ganesh

Shout it

About these ads

Posted in ASP.NET MVC, JQuery | Tagged: , | 4 Comments »

e-Commerce using ASP.NET MVC Framework

Posted by Ramani Sandeep on December 18, 2009

In this two-part series, you will learn how to a typical front end of an e-commerce system using the great Microsoft ASP.NET MVC 1.0 framework.

In the first part, we will focus upon the following points:

  • system design
  • functionality design
  • architecture design and
  • database design etc…

In the second part, we will discuss the detailed coding related things.

Introduction

With the rapid development of Internet, online book sales, as a typical example of the development of Web e-commerce systems, have been deeply mixed up with people’s daily life. Staying at home, people can choose to buy their own favorite variety of books, which greatly shortens the buying time and improves efficiency. Across time and spatial constraints to business circulation, online book sales system has not only brought great changes in commercial circulation, but also brought conveniences to consumers.

Based on the famous MVC design pattern, Microsoft ASP.NET MVC provides a design framework and technical foundation for creating web applications under the .NET platform. It is a lightweight, highly testable framework, which combines the existing excellent ASP.NET characteristics (such as the Master pages, etc.).

It is worth noting that ASP.NET MVC framework has greatly simplified the complex part of programming inside the ASP.NET Web forms solution; and, at the same time, whether the strength or flexibility are concerned, they are not inferior to the latter at all.

In this two-part series, we will construct a client side of an online book sales system using the ASP.NET MVC framework.

Read more

Shout it

kick it on DotNetKicks.com

Posted in ASP.NET MVC | Tagged: , , , | 5 Comments »

If At First You Don’t Succeed – Retrying Mail Operations in .NET

Posted by Ramani Sandeep on September 21, 2009

Mail sent from your application didn’t go through? Don’t give up so easily! The majority of mail server interruptions are very temporary in nature, lasting only a few seconds. Instead of failing right away, why not give your SMTP client another shot?

As I’m sure you’re very aware, sending email from applications is an extremely common task. For example, just about every web site has a “Contact Us’ page of some sort. Yours are probably much prettier that the screenshot below, but the idea is the same.

my1

If you only need to send mail from this one place, you might stick the required code directly in the code-behind of your contact page. However, most applications need to send mail for all kinds of reasons – to confirm new member signups, subscription requests, password changes and resets, and various other notifications based on your business rules. Therefore, it’s much more convenient to encapsulate the mail-sending logic and just call it from wherever you need to, as below.

Read more…

Posted in ASP.NET, ASP.NET Ajax, ASP.NET MVC, C# 2.0 | Tagged: , , | Leave a Comment »

What is Maximum Request size for asp.net application?

Posted by Ramani Sandeep on September 21, 2009

The default max request size is 4MB (4096).

You can change a setting in your web.config to allow larger requests.

Here is the example:

   1: <configuration>

   2:        <system.web>

   3:            <httpRuntime  maxRequestLength="4096"/>

   4:        </system.web>

   5: </configuration>

This is default setting, we have to change this to the size that you want to allow user to request like 5MB, 6MB…

Hope this will Help !!!

Posted in ASP.NET, ASP.NET Ajax, ASP.NET MVC | Tagged: , , , | 1 Comment »

Using jQuery Grid With ASP.NET MVC

Posted by Ramani Sandeep on August 27, 2009

A common scenario when building web user interfaces is providing a pageable and sortable grid of data. Even better if it uses AJAX to make it more responsive and snazzy. Since ASP.NET MVC includes jQuery, I figured it’d be fun to use a jQuery plugin for this demo, so I chose jQuery Grid.

After creating a standard ASP.NET MVC project, the first step was to download the plugin and to unzip the contents to my scripts directory per the Installation instructions.

 

Click here to read more…..

Posted in ASP.NET Ajax, ASP.NET MVC, JQuery | Tagged: , , , | 2 Comments »

Deploying ASP.NET MVC

Posted by Ramani Sandeep on August 27, 2009

here are the useful articles that helps you in deploying MVC application on Remote Server / IIS with different version.

1. Bin Deploying ASP.NET MVC

With the release of ASP.NET MVC Beta, the assemblies distributed with ASP.NET MVC are automatically installed into the GAC.

  • System.Web.Mvc
  • System.Web.Routing
  • System.Web.Abstractions

While developing an application locally, this isn’t a problem. But when you are ready to deploy your application to a hosting provider, this might well be a problem if the hoster does not have the ASP.NET MVC assemblies installed in the GAC.

Fortunately, ASP.NET MVC is still bin-deployable. If your hosting provider has ASP.NET 3.5 SP1 installed, then you’ll only need to include the MVC DLL. If your hosting provider is still on ASP.NET 3.5, then you’ll need to deploy all three. It turns out that it’s really easy to do so.

Click here to read more….

 

2. ASP.NET MVC on IIS 6 Walkthrough

I’ve seen a lot of reports where people have trouble getting ASP.NET MVC up and running on IIS 6. Sometimes the problem is a very minor misconfiguration, sometimes it’s a misunderstanding of how IIS 6 works.

In this post, I want to provide a definitive guide to getting ASP.NET MVC running on IIS 6. I will walk through using the .mvc or .aspx file extension for URLs first, then I will walkthrough using extension-less URLs.

If you’re running into problems with IIS 6 and ASP.NET MVC, I recommend trying to walk through all the steps in this post, even if you’re not interested in using the .mvc or .aspx mapping. Some of the lessons learned here have more to do with how ASP.NET itself works with IIS 6 than anything specific to ASP.NET MVC.

Click here to read more….

 

3. Using ASP.NET MVC with Different Versions of IIS

In this tutorial, you learn how to use ASP.NET MVC, and URL Routing, with different versions of Internet Information Services. You learn different strategies for using ASP.NET MVC with IIS 7.0 (classic mode), IIS 6.0, and earlier versions of IIS.

Click here to read more….

Posted in ASP.NET MVC | Tagged: , , | Leave a Comment »

IQueryable vs IEnumerable

Posted by Ramani Sandeep on August 26, 2009

The primary difference is that the extension methods defined for IQueryable<T> take Expression objects instead of Functional objects, meaning the delegate it receives is an expression tree instead of a method to invoke.

IEnumerable<T> is great for working with in-memory collections, but IQueryable<T> allows for a remote data source, like a database or web service.

IEnumerable doesn’t have the concept of moving between items, it is a forward only collection. It’s very minimalistic; something that most any data source can provide. Using only this minimal functionality, LINQ can provide all of these great operators.

IQueryable<T> is a very powerful feature that enables a variety of interesting deferred execution scenarios (like paging and composition based queries).

Hope this helps !!!

Reference Links :

Posted in ASP.NET, ASP.NET MVC, Linq | Tagged: , , , | 2 Comments »

Entity Framework

Posted by Ramani Sandeep on August 26, 2009

The challenge of bringing data from efficient storage engines such as SQL Server into object-oriented programming models is hardly a new one. Most developers address this challenge by writing complex data access code to move data between their applications and the database. However, writing such code requires an understanding of the database, so that you can access data either from the raw tables, from views, or from stored procedures.

More often than not, databases are managed by DBAs whose job it is to ensure that the database is available, powerful, efficient, and secure. The means of accomplishing this generally take the data further out of the scope of your own concepts of how your data should be structured in your applications. It requires a solid knowledge of the database schema, table definitions, and stored procedures along with their parameters and results, views, keys, and more, so that you can create your data access code.

Entity-relationship modeling, introduced in the 1970s by Peter Chen, goes a long way toward solving this problem. Using entity-relationship modeling, programmers create a conceptual model of the data and write their data access code against that model, while an additional layer provides a bridge between the entity-relationship model and the actual data store. Most modeling, to date, gets done on a whiteboard.

With the ADO.NET Entity Framework, Microsoft has made entity-relationship modeling executable. They achieved this using a combination of XML schema files, behind the scenes code generation (creating .NET objects), and the ADO.NET Entity Framework APIs. The schema files define a conceptual layer to expose the data store’s (e.g., a SQL Server database) schema, and to create a map between that and your application-level objects. The ADO.NET Entity Framework allows you to write your programs against classes that are generated from this conceptual layer. The Framework then handles all the required translation as you extract data from the database and send it back in.

Figure 1: How the different layers of the Entity Data Model fit into your application.

This article provides an explanation of the basic concepts of ADO.NET Entity Framework, gives you an opportunity to get your hands dirty with code, and provides a glimpse into the possibilities that ADO.NET Entity Framework opens up for developers.

 

Click to read more…..

Posted in ADO.NET, ASP.NET, ASP.NET MVC | Tagged: , | Leave a Comment »

Dependency Injection Frameworks

Posted by Ramani Sandeep on August 26, 2009

Performing manual dependency injection (like we are above) works fine, but does become harder to maintain as the number of dependencies and components in an application increases.

Several dependency injection frameworks exist for .NET that can help provide even more dependency management flexibility.

These frameworks, also sometimes called “Inversion of Control” (IoC) containers, provide mechanisms that enable an additional level of configuration support for specifying and passing dependencies to objects at runtime (most often using constructor injection).

Some of the more popular OSS Dependency Injection / IOC frameworks in .NET include:

  1. AutoFac
  2. Ninject
  3. Spring.NET
  4. StructureMap
  5. Windsor

ASP.NET MVC exposes extensibility APIs that enable developers to participate in the resolution and instantiation of controllers, and which enables Dependency Injection / IoC frameworks to be cleanly integrated within this process.

Posted in ASP.NET MVC | Tagged: , , , , , | Leave a Comment »

What are the key difference between ASP.NET Webforms & ASP.NET MVC?

Posted by Ramani Sandeep on August 22, 2009

Here are some points that differentiate ASP.NET Web Forms from ASP.NET MVC:

  1. Webform Uses the ‘Page Controller’ pattern. Each page has a code-behind class that acts as a controller and is responsible for rendering the layout. MVC Uses the ‘Front Controller’ pattern. There is a single central controller for all pages to process web application requests and facilitates a rich routing architecture.
  2. Webform Uses an architecture that combines the Controller (code behind) and the View (.aspx). Thus the Controller has a dependency on the View. Due to this, testing and maintainability becomes an issue. MVC enforces a “separation of concerns”. The Model does not know anything about the View. The View does not know there’s a Controller. This makes MVC applications easier to test and maintain.
  3. In Webform the view is called before the controller, while in MVC Controller renders View based on actions as a result of the User Interactions on the UI.
  4. At Webforms core, you ‘cannot’ test your controller without instantiating a View. There are ways to get around it using tools. While ASP.NET MVC was designed to make test-driven development easier. You ‘can’ test your Controller without instantiating a View and carry out unit-tests without having to run the controllers in an ASP.NET process.
  5. WebForms manage state by using Viewstate and server-based controls. While MVC does not maintain state information by using Viewstate.
  6. WebForms support an event-driven programming style that is like Windows applications and is abstracted from the user. The State management is made transparent by using sessions, Viewstate etc… In the process, the HTML output is not clean making it difficult to manage later. The ViewState also increases your page size. In ASP.NET MVC, the output is clean and you have full control over the rendered HTML. The orientation is towards building standard compliant pages and provides full control over the behavior of an application.
  7. Deep understanding of HTML, CSS and JavaScript is not required to a large extent since the WebForm model abstracts a lot of these details and provides automatic plumbing. While abstracting details to provide ease of use, sometimes a solution is overcomplicated, than it needs to be. In MVC, A thorough understanding of how HTML, CSS and JavaScript work together is required. The advantage is you can do a lot of jQuery and AJAX stuff in an efficient and simple manner than you would do in an ASP.NET application.
  8. WebForms can drastically reduce time while building up intranet and internet applications that use a lot of controls (drag and drop model). Although this is true for development, a lot of time is spent later to code around limitations. In MVC, You lose the ‘drag and drop’ quick model of building your web applications. The focus is on control over the application behavior and test-driven development. The model is extensible and you do not have to spend time working around limitations.
  9. Relatively simple to learn and pickup. Works very well for developers who initially have trouble with the HTTP/HTML model and are coming from a similar WinForms oriented event model. In MVC, There is a learning curve to understand the why, when and how of ASP.NET MVC.
  10. Lesser amount of code is required to build Webapps since a lot of components are integrated and provided out of the box. You can also use a lot of data controls provided out of the box that rely on ViewState. In MVC, since the application tasks are separated into different components, amount of code required is more. Since ASP.NET MVC does not use ViewState, you cannot use Data controls like GridView, Repeater.
  11. Webforms works very well for small teams where focus is on rapid application development. MVC works well for large projects where focus in on testability and maintainability.

Reference : here

Posted in ASP.NET MVC | Tagged: , | 2 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 124 other followers