ASP Snippets

Categories






Alerts

Free Alerts

Your email will always be
private and will not be shared.




Follow us on twitter.


Welcome to

Welcome to ASP Snippets

Featured Snippet


Excel like AutoFilter Feature in ASP.Net GridView Control
Author:Mudassar Khan

Here Mudassar Ahmed Khan has explained how to add Excel like AutoFilter feature in ASP.Net GridView Control using DropDownList
Here I am explaining how to build a feature similar to Microsoft’s Excel AutoFilter in ASP.Net GridView control. Excel AutoFilter allows user to filter the records using the DropDownList in the header, so lets start with the tutorial   GridView Markup <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns = "false" AllowPaging = "true" PageSize = "10"  Font-Names = "Arial" Font-Size = "11pt" AlternatingRowStyle-BackColor = "#C2D69B"  HeaderStyle-BackColor = "green"  OnPageIndexChanging = "OnPaging"> <Columns>     <asp:BoundField DataField="ContactName" HeaderText="Contact Name" />     <asp:BoundField ... [More]

Posted: Nov 26 2009, 23:03 by Mudassar Khan | Comments(3)RSS comment feed | Filed under : ASP.Net | C# | GridView | VB.Net



Recently Added






Most Viewed


Excel like AutoFilter Feature in ASP.Net GridView Control

Here Mudassar Ahmed Khan has explained how to add Excel like AutoFilter feature in ASP.Net GridView Control using DropDownList
Here I am explaining how to build a feature similar to Microsoft’s Excel AutoFilter in ASP.Net GridView control. Excel AutoFilter allows user to filter the records using the DropDownList in the header, so lets start with the tutorial   GridView Markup <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns = "false" AllowPaging = "true" PageSize = "10"  Font-Names = "Arial" Font-Size = "11pt" AlternatingRowStyle-BackColor = "#C2D69B"  HeaderStyle-BackColor = "green"  OnPageIndexChanging = "OnPaging"> <Columns>     ... [More]

Posted: Nov 26 2009, 23:03 by Mudassar Khan | Comments(3)RSS comment feed | Filed under : ASP.Net | C# | GridView | VB.Net

Export GridView To Word/Excel/PDF/CSV in ASP.Net

Here Mudassar Ahmed Khan has explained how to export GridView to Word, Excel, PDF and CSV documents
In this article, I will explain how to export GridView to Word, Excel, PDF and CSV formats. Exporting to Word, Excel and CSV can be easily achieved using ASP.Net without any third party tools, but for exporting GridView to PDF I am using iTextSharp which is a free library for exporting html to PDF.   To start with I have a GridView in which I am showing Customers records from the NorthWind Database. The HTML markup of the GridView is as shown below   <asp:GridView ID="GridView1" runat="server"     AutoGenerateColumns = "false" Font-Names = "Arial"     Font-Size = "11pt" ... [More]

Posted: Mar 14 2009, 23:11 by Mudassar Khan | Comments(185)RSS comment feed | Filed under : ASP.Net | C# | VB.Net | GridView

Save and Retrieve Files from SQL Server Database using ASP.Net

Files can be easily saved in the SQL Server Database Saving it in database makes it easily manageable. Here I will explain how to save and retrieve files from database.   Database Design   Here I have created a Database called dbFiles and it has a table called tblFiles. It has 4 Fields. The complete description is available in the Figure below   As you can see above for the id field I have set Identity Specification true, so that it automatically increments itself.   Field Relevance id Identification Number Name File Name Content ... [More]

Posted: Feb 19 2009, 04:49 by Mudassar Khan | Comments(118)RSS comment feed | Filed under : ADO.Net | C# | SQL Server | VB.Net

Display Images from Database using ASP.Net

How to retreive images saved in database and display them using ASP.net Image Control
In my previous article I explained Save and Retrieve Files from SQL Server Database using ASP.Net. Here I will explain how to display images that are saved in database.   I have saved images of three different formats i.e. JPEG, GIF and PNG in the Database. Refer figure below. Retreive the Images   To retreive pictures from database I have created a Picture Page. The page will receive ImageID as the ID of the Saved image as QueryString Parameter. Based on the QueryString Parameter, the page will retreive the image and write it to the Response. Refer the Code Below   C# [ImageCSharp.aspx]     protected void Page_Load(object sender, EventArgs ... [More]

Posted: Feb 21 2009, 03:39 by Mudassar Khan | Comments(19)RSS comment feed | Filed under : ADO.Net | C# | SQL Server | VB.Net

Send Email using CSharp

Namespaces The following Namespaces need to be imported in order to send emails using System.Net; using System.Net.Mail; MailMessage Class Properties Following are the required properties of the mail message class. From – Sender’s email address To – Recipient(s) Email Address CC – Carbon Copies BCC – Blind Carbon Copies Subject – Subject of the Email  Body – Body of the Email IsBodyHtml – Specify whether body contains text or HTML mark up. Attachments – Attachments if Any. ReplyTo – ReplyTo Email address. Creating a MailMessage Object MailMessage mm = new MailMessage(); mm.From = new MailAddress("username@gmail.com"); ... [More]

Posted: Feb 01 2009, 04:21 by Mudassar Khan | Comments(3)RSS comment feed | Filed under : C#














Community News





Web Hosting SpotLight


Consulting


For consulting and work related queries click here.



Advertise


Advertise with us. For more details click here.


Suggestions


Please provide your valuable suggesstions here.

This Site is hosted on

Lunarpages.com Web Hosting



Getting started with ASP.NET Core MVC and Entity Framework Core using Visual Studio

The Contoso University sample web application demonstrates how to create ASP.NET Core 1.0 MVC web applications using Entity Framework Core 1.0 and Visual Studio 2015. The sample application is a ...


Application Startup

ASP.NET Core provides complete control of how individual requests are handled by your application. The Startup class is the entry point to the application, setting up configuration and wiring u...


Migrating From ASP.NET MVC to ASP.NET Core MVC

This article shows how to get started migrating an ASP.NET MVC project to ASP.NET Core MVC . In the process, it highlights many of the things that have changed from ASP.NET MVC. Migrating from A...


File Providers

ASP.NET Core abstracts file system access through the use of File Providers. Sections: File Provider abstractions File Provider implementations Watching for changes Globbing pa...


ASP.NET Web API Help Pages using Swagger

Understanding the various methods of an API can be a challenge for a developer when building a consuming application. Generating good documentation and help pages as a part of your Web API using ...


Dependency Injection

Steve Smith , Scott Addie ASP.NET Core is designed from the ground up to support and leverage dependency injection. ASP.NET Core applications can leverage built-in framework services by having ...


Creating Backend Services for Native Mobile Applications

Mobile apps can easily communicate with ASP.NET Core backend services. Sections: The Sample Native Mobile App Creating the ASP.NET Core Project Creating the Controller Common W...


Manage Client-Side Packages with Bower

Bower is a &#8220;package manager for the web.&#8221; Bower lets you install and restore client-side packages, including JavaScript and CSS libraries. For example, with Bower you can install CSS fi...


Custom Policy-Based Authorization

Underneath the covers the role authorization and claims authorization make use of a requirement, a handler for the requirement and a pre-configured policy. These building blocks allow you to...


Creating a complex data model

The Contoso University sample web application demonstrates how to create ASP.NET Core 1.0 MVC web applications using Entity Framework Core 1.0 and Visual Studio 2015. For information about the tutor...


Sorting, filtering, paging, and grouping

The Contoso University sample web application demonstrates how to create ASP.NET Core 1.0 MVC web applications using Entity Framework Core 1.0 and Visual Studio 2015. For information about the tuto...


Getting Started with ASP.NET Core and Entity Framework 6

This article will show you how to use Entity Framework 6 inside an ASP.NET Core application. Sections: Overview Reference full framework and EF6 in the ASP.NET Core project Handle ...


Create, Read, Update, and Delete operations

The Contoso University sample web application demonstrates how to create ASP.NET Core 1.0 MVC web applications using Entity Framework Core 1.0 and Visual Studio 2015. For information about the tuto...


Reading related data

The Contoso University sample web application demonstrates how to create ASP.NET Core 1.0 MVC web applications using Entity Framework Core 1.0 and Visual Studio 2015. For information about the tutor...


Advanced topics

The Contoso University sample web application demonstrates how to create ASP.NET Core 1.0 MVC web applications using Entity Framework Core 1.0 and Visual Studio 2015. For information about the tutor...


What's New in ASP.NET 4.5 and Visual Studio 2012

This document describes new features and enhancements that are being introduced in ASP.NET 4.5. It also describes improvements being made for web development in Visual Studio 2012.


Getting Started with ASP.NET Web API

In this tutorial, you will create your first HTTP service using ASP.NET Web API.


Getting Started with ASP.NET MVC

This tutorial series will teach you the basics of building an ASP.NET MVC application.


Introducing ASP.NET Web Pages

These articles will get you started with ASP.NET Web Pages.


Getting Started with ASP.NET Web Forms

This tutorial series will teach you the basics of building an ASP.NET Web Forms application