Posted by Ramani Sandeep on February 23, 2010
The common scenario to reach the desired page on the internet is to write the URL to a browser and press Enter. Basically say the browser asks a server for the requested page. The server builds the page (HTML) and sends the result back to the browser. The browser displays the result to the user and makes HTTP requests to other content like images, etc. Let’s jump back to the stage when the server is building the content of the page. Some parts of the page are usually static data immediately available to use. Another data of the page could be dynamic, either from huge database heavy for calculation or from another server like RSS channel. The point is that some of the data is quickly available and some of the data need time to be loaded. The HTML build by server isn’t sending to the browser until it is completely created. That is obvious.
Hope this will help
Posted in ASP.NET 3.5, ASP.NET Ajax, JQuery | Tagged: Web Page Loading in Steps | 4 Comments »
Posted by Ramani Sandeep on February 8, 2010
This post is a tutorial on how to create a web-service which can be called from java-script and then continues on to show you how to use it with the Virtual Earth map control.
Hope this helps
Posted in ASP.NET 3.5, Web Services | Tagged: Using Virtual Earth control with a Web-Service, Virtual Earth | Leave a Comment »
Posted by Ramani Sandeep on February 1, 2010
A frequent requirement for ASP.NET developers is to schedule tasks at regular intervals. This can include site maintenance tasks, like cleaning up old files, emailing newsletters on a schedule etc. This article examines one easy option for managing tasks like these without having to configure external tools, and discusses a couple of alternatives.
Simulate a Windows Service using ASP.NET to run scheduled jobs By Omar Al Zabir
How to run scheduled jobs from ASP.NET without requiring a Windows Service to be installed on the server? Very often we need to run some maintenance tasks or scheduled tasks like sending reminder emails to users from our websites. This can only be achieved using a Windows service. ASP.NET being stateless provides no support to run some code continuously or to run code at a scheduled time. As a result, we have to make our own Windows Services in order to run scheduled jobs or cron jobs. But in a shared hosted environment, we do not always have the luxury to deploy our own Windows service to our hosting provider�s web server. We either have to buy a dedicated server which is very costly, or sacrifice such features in our web solution. However, running a scheduled task is a very handy feature especially for sending reminder emails to users, maintenance reports to administrators, or run cleanup operations etc. So, I will show you a tricky way to run scheduled jobs using pure ASP.NET without requiring any Windows service. This solution runs on any hosting service providing just ASP.NET hosting. As a result, you can have the scheduled job feature in your ASP.NET web projects without buying dedicated servers.
Hope this helps
Posted in ASP.NET, ASP.NET 3.5, ASP.NET 4.0 | Tagged: Gloabal.asax, Task Scheduling using Global.asax | Leave a Comment »
Posted by Ramani Sandeep on January 30, 2010
The Exceptional Performance team has identified a number of best practices for making web pages fast. The list includes 34 best practices divided into 7 categories.
- Minimize HTTP Requests
- Reduce DNS Lookups
- Avoid Redirects
- Make Ajax Cacheable
- Post-load Components
- Preload Components
- Reduce the Number of DOM Elements
- Split Components Across Domains
- Minimize the Number of iframes
- Use a Content Delivery Network
- Add an Expires or a Cache-Control Header
- Gzip Components
- Configure ETags
- Flush the Buffer Early
- Use GET for AJAX Requests
- Put Stylesheets at the Top
- Avoid CSS Expressions
- Choose <link> over @import
- Avoid Filters
- Put Scripts at the Bottom
- Remove Duplicate Scripts
- Minimize DOM Access
- Develop Smart Event Handlers
- Reduce Cookie Size
- Use Cookie-free Domains for Components
- Optimize Images
- Optimize CSS Sprites
- Don’t Scale Images in HTML
- Make favicon.ico Small and Cacheable
- Keep Components under 25K
- Pack Components into a Multipart Document
Posted by Ramani Sandeep on January 25, 2010
Cascading drop down lists is a really nice feature for web developers. I thought it was time to write an article on how to do this using ASP.NET and jQuery. Well here’s one way of doing it. Before we get started, this example uses the latest version of jQuery which is 1.3.2. That can be downloaded from here.
Read full article here :
Hope this will help
Posted in ASP.NET 3.5, JQuery | Tagged: Cascading DropDownList, Cascading DropDownLists With ASP.NET and jQuery | 3 Comments »
Posted by Ramani Sandeep on January 8, 2010
ASP.NET Dynamic Data brings major usability and RAD development changes to the existing ASP.NET data controls. RAD development is significantly increased by the use of a rich scaffolding framework. After you add a LINQ to SQL or Entity Framework data model to a project, you can simply register it with Dynamic Data. The result is a fully functional Web site. Full CRUD (create, read, update, and delete) operations are supported. The site includes filtering by foreign keys and Boolean fields; foreign keys are automatically converted to their friendly names. Smart validation is automatically available, which provides validation based on database constraints for nullable fields, data type, and field length.
The DetailsView and GridView controls have been extended to display fields by using templates instead of by using hard-coded rules that are programmed in the controls. These templates are part of the project, and you can customize them to change their appearance or to specify which controls they use for rendering. This makes it very easy to make a change in one place in your site that specifies how to present dates for editing, as one example. FormView and ListView controls can implement similar behavior by using a DynamicControl object in their templates and by specifying which field in the row to display. Dynamic Data will then automatically build the UI for these controls based on the templates that you specify.
Validation is significantly improved in the controls as well. The controls read metadata for a LINQ to SQL or Entity Framework data model and provide automatic validation based on the model. For example, if a column in the database is limited to 50 characters, and if a column is marked as not nullable, a RequiredFieldValidator control is automatically enabled for the column. (The controls also automatically support data-model-level validation.) You can apply other metadata to take further control over display and validation.
Hope this will Helps
Posted in ASP.NET, ASP.NET 3.5, ASP.NET 4.0 | Tagged: ASP.NET Dynamic Data, ASP.NET Dynamic Data Support, Dynamic Data | Leave a Comment »
Posted by Ramani Sandeep on January 5, 2010
New Features in ASP.NET 3.5
The .NET Framework version 3.5 includes enhancements for ASP.NET in the following areas:
- A new EntityDataSource control that exposes the Entity Data Model through the ASP.NET data source control architecture.
- A new ListView data control that displays data and that provides a highly customizable UI.
- A new LinqDataSource control that exposes Language-Integrated Query (LINQ) through the ASP.NET data source control architecture.
- A new merge tool (Aspnet_merge.exe) that merges precompiled assemblies to support flexible deployment and release management. This feature is not available in Visual Web Developer Express Edition.
ListView Data Control
The ListView control combines many aspects of existing data controls. The ListView control is useful for displaying data in any repeating structure, similar to the DataList and Repeater controls. Unlike those controls, the ListView control supports edit, insert, and delete operations as well as sorting and paging. The paging functionality is provided for ListView by the new DataPager control.
The ListView control is a highly customizable control that enables you to use templates and styles to define the control’s UI. Like the Repeater, DataList, and FormView controls, templates in the ListView control are not predefined to render specific UI in the browser.
The DataPager control is used to page through data that is displayed by a control that implements the IPageableItemContainer interface, such as the ListView control. The DataPager control supports built-in paging UI. You can specify the paging UI by using the NumericPagerField object, which lets users select a page by page number. You can also use the NextPreviousPagerField object, which lets users navigate through pages one page at a time, or to jump to the first or last page. Alternatively, you can create custom paging UI by using the TemplatePagerField object.
The LinqDataSource control exposes Language Integrated Query (LINQ) through the ASP.NET data source control architecture. You use the LinqDataSource control when you are creating a Web page that retrieves or modifies data and you want to use the programming model that is provided by LINQ. You can simplify the code in a Web page by enabling the LinqDataSource control to automatically create the commands for interacting with the data. By using the LinqDataSource control, you can reduce the amount of code that you must write to perform data operations when compared to performing the same operations in the SqlDataSource control or the ObjectDataSource control. When you use the LinqDataSource control, you also benefit by learning only one programming model to interact with different types of data sources.
You can use declarative markup to create a LinqDataSource control that connects to data from either a database or a data collection such as a collection. In the markup, you can specify the criteria for displaying, filtering, ordering, and grouping data. When the data source is an SQL database table, you can also configure a LinqDataSource control to update, insert, and delete data. You do not have to write the SQL commands to perform these tasks. The LinqDataSource class provides an event model that enables you to customize display and update behavior.
ASP.NET Merge Tool
The ASP.NET merge tool (Aspnet_merge.exe) lets you combine and manage assemblies that are created by the ASP.NET pre-compilation tool (Aspnet_compiler.exe). (The merge tool was released earlier as an add-on for Visual Studio 2005,) The merge tool creates single assemblies for the site. You can create an assembly for the whole Web site, for each Web site folder, or for just the files that make up the Web site UI (pages and controls).
New features introduced in ASP.NET 4.0 & Visual Studio 2010
- Code Snippets
- New Profiles
- Generate From Usage
- Code Navigation in Class Files
- Code Navigation
- View Call Hierarchy
- Code Identifier Highlighting
- Intellisense Improvements
- Web.Config Transformation
- URL Routing
- Add Reference Dialog
- Compressing Session Values
- Improvements in C# 4.0
- Dynamic lookup
- Named parameters
- Optional parameters
- Meta Tags
- Generating Client IDs
- Permanent Redirect
- New Browser Definitions
- Publishing a Project
- Deploy SQL
- Silverlight Applications
Posted in ASP.NET 3.5, ASP.NET 4.0, C# 3.0 | Tagged: ASP.NET 4, What is new in ASP.NET 3.5, What is new in ASP.NET 4.0 | 1 Comment »
Posted by Ramani Sandeep on December 29, 2009
With the release of URL-rewrite module for IIS 7.0 and the inclusion of ASP.NET routing into the .NET Framework 3.5 SP1, there have been a lot of questions from ASP.NET developers about how these two features relate to each other and when to use each. The intention of this document is to describe the differences between these two technologies and to provide guidance for Web developers on when to use IIS URL rewriting and when to use ASP.NET routing.
From a high-level point of view, it may seem that these technologies provide very similar functionality–both allow your Web applications to have user-friendly and search-engine-friendly URLs. However, there are fundamental differences between these two technologies that are important to understand in order to make the right choice when deciding what to use for your Web application. In order to help you understand those, we will first explain how IIS URL rewriting and ASP.NET routing work.
Posted in ASP.NET 3.5 | Tagged: ASP.NET routing, ASP.NET URL Rewrite Module, IIS URL Rewriting and ASP.NET routing, URL Rewriting | Leave a Comment »
Posted by Ramani Sandeep on December 11, 2009
Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program’s operation if properly and appropriately used. The opposite of lazy loading is Eager Loading.
Article – 1: jQuery Tabs and Lazy Loading by Malcolm Sheridan
In this article I will connect to the Northwind database using LINQ to SQL, and display customer and product information in separate tabs. I’ll also show you one way of lazy loading these tabs so the data is retrieved only once, not each time a tab is selected.
Article – 2: Lazy Loading jQuery Tabs with ASP.NET by Mikesdotnetting
This article looks at efficient use of jQuery tabs when displaying data. Specifically, it covers how to lazy-load data, so that it is only accessed and displayed if the tab is clicked.
Lazy Loading is a well-known design pattern that is intended to prevent redundant processing within your application. In the case of tabbed data, there seems little point retrieving and binding data that appears in a tabbed area that no one looks at. So, this examples covers how to defer data access and display until the user wants it – which is defined by them clicking the relevant tab.
Article – 3: Eager Loading and Lazy Loading in ADO.NET Data Services by Gil Fink
The default behavior of a data service’s .NET client is not to load the entities’ associated objects. When we request an entity we will get it from the service but its associated objects will not load up at all.
Lets say that I have two entities in my program
The associations between the entities are that a department can have a lot of courses and a course belongs to one department.
When I load a department it’s list of courses will be empty. trying to iterate the list of courses will give nothing because the courses will not load until we tell them to be loaded explicitly.
This is done by the LoadProperty method of the data service context.
I have a great learning experience thru this.
Now its your turn to have it.
Posted in ASP.NET, ASP.NET 3.5, ASP.NET Ajax, C# 3.0, JQuery, Linq | Tagged: Eager loading, Eager Loading and Lazy Loading in ADO.NET Data Services, jQuery Tabs and Lazy Loading, lazy loading, lazy loading .net, lazy loading asp.net, lazy loading in asp.net, Lazy Loading jQuery Tabs with ASP.NET | Leave a Comment »