Saturday, February 20, 2010

Create Event Organizer using ASP.NET Calendar Control

Calendar control is one of the most exciting controls in ASP.NET. It has many properties to customize the appearance of the control according to your application requirements. It does not support data binding, but it is still possible to customize the contents of this control by using some of its events. In the following tutorial, I will show you how you can create one simple online event organizer using its DayRender Event.

How to send Plain Text Email in ASP.NET 2.0

.NET Framework namespace System.Net.Mail contains many classes developers can use to send all types of emails in ASP.NET 2.0. In the following tutorial I will show you how you can send a simple plain text email in ASP.NET 2.0.

Send Emails in ASP.NET 2.0 with Authentication

Sending emails from ASP.NET 2.0 application is made very simply using MailMessage and SmtpClient classes available in System.Net.Mail namespace in .NET Framework. Sometimes SMTP server required authentication information of email client to send emails. In the following tutorial, I will show you how you can authenticate smtp client when sending emails in ASP.NET 2.0.

Using Checkbox in ASP.NET GridView Control

ASP.NET GridView Control provides developers ability to use any type of ASP.NET control in its columns using TemplateField. Developers are free to use Buttons, DropDownList, RadioButtons or any other control according to their application requirement. One of the most common control developers uses in the GridView is CheckBox control and if you are creating Administration Panel of any ASP.NET Application you may be required to handle checkbox event to update any back end database table. One Typical example is to Enable/Disable status of any record in the database table using the CheckBox in the GridView. In the following tutorial I will show you how you can use CheckBox in the GridView which not only display the current status of the record but also update the record status in the database.

This tutorial will show you how to use CheckBox inside GridView and how to handle its events to update database records based on its Checked state.

Generating RSS Feed from ASP.NET

If you are a regular visitor of blogs, contents publishing or news related websites you must have noticed a small RSS or XML icon somewhere on the page. This is very useful technique which content presenters or authors used fairly regularly on blogs to publish their articles or tutorials to other websites who subscribed to their feeds. In this article I will show you how to generate RSS feed for your ASP.NET websites.

Editing Data using ASP.NET GridView Control

The visitors to a web site can typically be divided into two groups: the users and the administrators. In data driven web sites, users are normally allowed to view data and administrators are allowed to add, edit or delete data. In this tutorial I will show you how you can create an editable GridView control for administrators to modify database records directly into the GridView control.

Paging Repeater Control using PagedDataSource

Paging large database result sets is very important and common feature in modern websites. For ASP.NET developers, Microsoft has build paging functionality into the GridView control by default and developers just have to set some simple properties true and that’s all they need to have paging in their websites. Many developers prefer Repeater or DataList control over GridView due to its large overhead. In this Tutorial, I will show you how you can do paging using light weight ASP.NET Repeater control and PagedDataSource class.

Thursday, February 4, 2010

Saving images in database using ASP.NET FileUpload Control



Saving and displaying images in database tables is a common requirement in ASP.NET projects. There are two ways to store images in database either you store image URLs in database as normal string or you store image as binary data. In this tutorial I will show you how you can upload and save images directly in SQL Server database table as binary data.


Display images in DataList from Database

In one of my previous article I have shown you how you can save images in database as binary data using File Upload control. I have received many requests to write an article on displaying binary images from the database in a data bound control such as DataList or GridView. In this tutorial I will show you how you can achieve this with only few lines of code.

Display Microsoft Excel File in ASP.NET GridView



Microsoft Excel is still very powerful and widely used tool in almost all the companies. Many people use it extensively to store and analyze tabular data without learning a relational database management system such as SQL Server or Oracle. If you are creating ASP.NET website, there are chances that the data is made available to you in an Excel file and reading and displaying Excel data in ASP.NET page can make your applications more powerful for analysis. In this tutorial I will show you how to read Excel file and displaying data in ASP.NET GridView control.

Export ASP.NET GridView to Excel


 Many developers use GridView control to display web reports in their ASP.NET websites. GridView control render data in a tabular form just like HTML tables but it lack the functionality of exporting its contents to any other format such as Excel of PDF file. It is very common requirements of many clients to export web report data to Excel file so that they can perform some analysis using Excel built in features. In this Tutorial I will show you how to export GridView control as Excel File.


Deleting multiple Rows in GridView using Checkbox

In one of my other article “Using Checkbox in ASP.NET GridView Control”, I have shown you how you can update the row status in database using checkboxes in GridView. There are situations when you want to provide checkboxes in GridView for deleting multiple database records similar to Hotmail or Yahoo inboxes. GridView control allows you to delete only a single record at a time but in this tutorial I will show you how you can implement multiple records deletion scenario in GridView control.

Wednesday, February 3, 2010

Formatting GridView output based on Data

ASP.NET GridView control is the most commonly used control for displaying data on the web page. If you want to display database records as HTML table “as is”, it is very easy to accomplish using GridView. Sometimes you want to customize the HTML output of the GridView and want to display data differently based on its value. In this tutorial I will show you how you can call custom formatting functions inside GridView to customize GridView control.

Displaying Total in Footer of GridView

During my training career, I have been asked one common question several times that how we can calculate summary totals inside GridView control and how we can show it at the footer of GridView control. So I have decided to write a tutorial on this topic. In this tutorial I will show you how you can calculate and display totals not only in GridView footer but also on any control outside GridView control.

Display XML Document in ASP.NET using XML Control

 

XML is now one of the most common buzzword in software development. Its use is widely spread in almost all the modern technologies including .NET Framework that provides many useful classes to work with XML Documents in System.Xml namespace. XML Documents contain raw data without any formatting or esentation logic and developers use XSLT to transform XML documents into other formats such as HTML. ASP.NET added a new control in version 2.0 called XML control which can be used to transform and display XML documents in ASP.NET pages with ease. In this tutorial I will show you how you use ASP.NET XML Server Control to present XML data.

Display Master/Details output with Nested GridView Controls

GridView control provides very flexible way to display, select, sort or edit data on ASP.NET page with ease but it does not provide an easy way to create nested grid to display master details views of your database tables. By nesting I mean you are trying to put one GridView inside another GridView to display better details view for the users. In this tutorial I will show you how easy it is to implement nested GridView scenario with minimum code.

Transform XML Document Programmatically using XmlCompiledTransform

In one of my previous tutorials I have shown you how you can transform XML documents using XSLT files with the help of ASP.NET XML server control. I have received many queries asking me how we can achieve similar functionality programmatically. In this tutorial I will show you how to transform an XML document using .NET Framework built in XmlCompiledTransform class available in System.Xml.Xsl.

Tuesday, February 2, 2010

Display Data using new ListView Control in ASP.NET 3.5

In ASP.NET 3.5, Microsoft introduced two new databound controls: the ListView and DataPager control which you can use to display and paginate your data in extremely flexible way. In this tutorial I will show you how you can use ListView control to display data from the database. I will introduce you how different templates in ListView control work and how you can use ListView control to render any type of HTML markup you want.

Selecting Data in ASP.NET 3.5 ListView Control

The new ListView control introduced in ASP.NET 3.5 allows you to display, select, edit, update, delete, sort and paginate your data in extremely flexible way. In one of my other tutorial I have shown you how you can use ListView control to display data. This tutorial covers how to provide selection feature in ListView control. I will introduce you SelectedItemTemplate of ListView control which you can use to render the contents of the selected item.

Understanding ASP.NET ObjectDataSource Control

The ObjectDataSource control allows you to bind your data bound controls to custom .NET business objects Using ObjectDataSource control, accessing and displaying data from a Business Login Layer can be accomplished without writing a single line of code. In this tutorial I will show you how you can use ObjectDataSource control to call methods from custom business objects and how you can bind ObjectDataSource control with ASP.NET data bound controls such as GridView.

Using Parameters with ObjectDataSource Control

In one of my earlier tutorial I have shown you how you can call methods from custom .NET objects available in your Business Login Layer. In this tutorial, I will show you how to invoke methods which are expecting input parameters from the web form to perform their job. I will also illustrate how to pass values for these input parameters using ObjectDataSource control parameter collections.

Insert Records using ObjectDataSource Control

The ObjectDataSource control enables you to bind Databound controls such as the GridView, FormView or DetailsView controls to a custom .NET component. Normally, these custom .NET components are available in Business Login Layer or Data Access Layer and they perform all basic operations such as Insert, Update, Delete or Selecting Data from the backend Data Source. In this tutorial I will show you how you can use ObjectDataSource control to insert data in Database. I will also show you how you can pass custom .NET objects as parameters and how you can handle exceptions while inserting data in Database.